aalan

Testing and Debugging in Adobe Analytics

Testing and Debugging are significant activities and it is required to capture the information in Analytics variable that in case it is required at sme point of time.

Following are the value one should capture in AA variable:

Page URL:

To capture the URL you can use the following line of JS code

location.protocol + ‘//’ + location.host + location.pathname;

Query String:

document.URL.split(“?”)[1];

AppMeasurement code version:

s.version

ECID/MCVID:


If the TMS is Adobe Launch or DTM you can use the below line of code.

_satellite.getVisitorId().getMarketingCloudVisitorID();

If visitorID.js is implemented by other method then use the following JS to capture the value of mid into Adobe Analytics Variable:

s_c_il[0]._fields.MCMID

VisitorAPI.js version

var VI= s_c_il[0].version;
return VI;

For all concatenated detail:

scVersion

To segregate you can use following code :

var fullcode=scVersion.split(‘|’);
var codeversion=fullcode[1];
var VI=fullcode[2];

IP Address:

Check legal/country/company policy before capturing this into AA variable.

User Agent:

bagent=navigator.userAgent;

There are 2 options to do this.

  • Put the value of IP in Data Layer and then populate that into AA variable
  • Use processing rule and populate the value into AA variable

Hope this helps to pick the testing and debugging parameter.

To test on how this works do to Adobe Launch TMS and add Adobe Analytics Extension. Under custom code add the following line of code, build the version and see the result under browser console:

// Extract Adobe Analytics core attributes for user session
var visitorAPI = s_c_il[0].version;
var visitorId = _satellite.getVisitorId().getMarketingCloudVisitorID();
var s_Code = s.version;
console.log(“visitorId: ” + visitorId);
console.log(“visitorAPI: ” + visitorAPI);
console.log(“s_Code: ” + s_Code);

Related Posts

Leave a comment

You must login to add a new comment.

[wpqa_login]