Expand my Community achievements bar.

SOLVED

In Web SDK - Using Variable data element - Using both XDM object or Data object not seeing calls in debugger

Avatar

Level 2

Hi,

I am trying my hands on Web SDK, I tried using the XDM object data element, and its successful for me.

But when I try to use variable data element using both xdm object or data object, both ways tried, I do not see any calls in the debugger.

I will explain the one approach I am using, probably the same issue exists on the second one.

1. What I am doing is, setting the data element variable and then selecting the data object.

2. Then in the rule, I am setting the update variable action and mapping variable there.

3. Then I set the second action that sends the event, in that I am using event type "Web Webpagedetails Page Views" and setting data, I tried setting both xdm and data, only xdm and only data, but nothing is working.

kaur_amneet_0-1717603322054.png

 

Please help me find what I am setting wrong.

Any help is appreciated.

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 2

My issue is resolved, the bug was in custom code, I was using const s = content.__adobe.analytics; and then s object to set some custom variables, which was causing the issue, then I replaced it with content.__adobe.analytics only not using s object and it started working.

 

Thanks, @Ankit_Chaudhary and @bjoern__koth for all your help.

View solution in original post

18 Replies

Avatar

Community Advisor

Hi @kaur_amneet 

To debug you implementation use the following steps.

  • Check if launch script is properly implemented on the page and it's loading properly.
  • Enable logs on console by using _satellite.setDebug(true)
  • Check if you have correctly configured services in your DataStream
  • Also while using data object to send data to AEP you need to use data prep to map your data to your XDM schema. Check this tutorial

Also from your screenshot it seems like you are trying to send XDM object using data field which may through some errors during the send event call.

You can send your complete non-XDM data layer using data field and use data prep to map that to your schema.

Avatar

Community Advisor

@kaur_amneet  as @Ankit_Chaudhary mentioned, the XDM object and data object are fundamentally different parts of the request payload.

Assuming Adobe has built in some checks on their end, dropping invalid data structures to not mess with your data on the Edge network.

 

To clarify

 

The XDM variables are the schemas you define on your request and can be set in the upper field. 

It generates the actual "xdm" field in the payload.

 

The data data element is to be added in the lower field.

It generates the free-form data section in your payload which does not run through any validation checks on the Edge network. In here, you will see something like

data: {
  __adobe: {
    analytics: {
      eVar99: "hello world"
    },
    target: {
      // some target contextual stuff
    },
  }
  // your own free form data
  foo: "bar",
  bla: "blub"
  myArr: [1,2,3]
}
Cheers from Switzerland!


Avatar

Level 2

Thank you @Ankit_Chaudhary  and @bjoern__koth for your replies, 

I checked the tutorial as well.

 

I am doing the following steps in setting up, I am trying both objects under the Data element.

 

1. Setting 2 Data elements, first one using XDM Object

kaur_amneet_0-1717684978018.png

 

1. a) Second one using Data Object in Variable data element

kaur_amneet_2-1717685157322.png

 

2. Then I am setting up the 2 separate rules for both.

kaur_amneet_1-1717685046878.png

 

3. Update Variable Action for XDM Object rule

kaur_amneet_3-1717685305552.png

 

3. a) Update Variable Action for Data object rule

kaur_amneet_4-1717685605800.png

 

4. Setting Send Event for XDM Object rule

kaur_amneet_7-1717685850411.png

 

4. a) Setting Send Event for Data Object rule

 

kaur_amneet_6-1717685798571.png

 

I am setting custom variables here in the update variable action.

Following this tutorial: https://www.youtube.com/watch?v=J4fuB2fki8o

 

Avatar

Level 2

The library gets loaded, and I can even see the web SDK library in the AEP debugger, the only thing is, I don't see any calls in the network tab or any data passing.

kaur_amneet_1-1717686583682.png

 

 

Avatar

Community Advisor

Use the XDM field to send XDM object not the data field.(Point 4 screenshot)

The configuration for sending data to Adobe analytics using data object seems fine, have you tried enabling logs over console? It might help you if any condition in your rules are crashing.

Avatar

Level 2

Thank you @Ankit_Chaudhary for your instant response.

I changed the suggested solution, Set the XDM field for the XDM object in the Send event.

 

Still do not see processed data.

 

Again see only library info for WebSDK, in console, and in AEP Debugger.

Yes, I tried enabling logs, only see info related to the web SDK library and rules I am setting they are not showing up.

 

Avatar

Community Advisor

Hi @kaur_amneet 

have you changed the consent settings in the WebSDK? What do you see as default consent when you open the WebSDK extension settings?

 

bjoern__koth_0-1717699269893.png

 

Cheers from Switzerland!


Avatar

Community Advisor

When you say "still do not see processed data", there are really no network requests in the debugger or in the network tab when filtering for "/ee" ? 
Should look somewhat like this.

bjoern__koth_0-1717699976596.png

 

Also, what happens when you set neither XDM nor data object? Is that triggering any call?

Cheers from Switzerland!


Avatar

Level 2

No Network request in the network tab on the AEP debugger and in Inspection tool.

kaur_amneet_0-1717705146165.pngkaur_amneet_1-1717705195245.png

kaur_amneet_2-1717705213336.png

 

To Answer the following question.

Also, what happens when you set neither XDM nor data object? Is that triggering any call?

 

Same thing I am seeing, I can see the library version of web SDK but no network request.

Avatar

Community Advisor

@kaur_amneet it's getting quite interesting, can you share the URL over message here or you can connect with me over linkedin 

Avatar

Community Advisor

@kaur_amneet 

With logging enabled, are you sure the rule's conditions are even met?

Just trying to rule out anything that may prevent the requestfrom firing.

 

Also, do you have any custom code in the "on before event send callback" of the extension that may return false?

Cheers from Switzerland!


Avatar

Community Advisor

Hi @kaur_amneet 

and if you just add a custom code action like this, do you see it?

 

alert("hello world")

 

Cheers

Cheers from Switzerland!


Avatar

Level 2

Hi @bjoern__koth ,

 

I already tried adding custom code but nothing is working.

Avatar

Community Advisor

hi @kaur_amneet 

Try checking if your changes are being updated in the launch script on your page.

  • check with _satellite._container on console and validate the environment and property are correct as on not.
  • go to sources tab check for assets.adobedtm.com > launch search with your rules names in the code and check if everything is updated or not.

If everything is fine try creating a new library in launch and adding all your changes again and try rebuilding it, this has worked for me in the past several times. 

Avatar

Level 2

Thanks @Ankit_Chaudhary,

I checked and I am seeing launch file updated with the rule name.

Also checked on the console, and Build Property, and library are correct.

kaur_amneet_0-1718124875289.png

 

Also, Created a new build to publish my changes, still do not see the data _analytics object in the browser or in the AEP debugger.

Avatar

Correct answer by
Level 2

My issue is resolved, the bug was in custom code, I was using const s = content.__adobe.analytics; and then s object to set some custom variables, which was causing the issue, then I replaced it with content.__adobe.analytics only not using s object and it started working.

 

Thanks, @Ankit_Chaudhary and @bjoern__koth for all your help.