• OurPcGeek
  • Posts
  • Essential Testing and Debugging Parameters for Adobe Analytics - Appmeasurment.js

Essential Testing and Debugging Parameters for Adobe Analytics - Appmeasurment.js

Mastering Analytics Debugging with Key Variables

Testing and debugging are critical components of any analytics implementation. Capturing the right information in Adobe Analytics (AA) variables is essential for troubleshooting and performance optimization. Here’s a detailed guide on what values you should capture and how to do it efficiently using JavaScript.

Key Variables to Capture in Adobe Analytics

1. Page URL

Capture the full URL of a webpage for tracking purposes.
Code:

location.protocol + '//' + location.host + location.pathname;

2. Query String

Track query string parameters to gain deeper insights into traffic sources.
Code:

document.URL.split("?")[1];

3. AppMeasurement Code Version

Monitor the AppMeasurement code version to ensure compatibility and debugging accuracy.
Code:

s.version;

4. ECID/MCVID

Track the Experience Cloud ID (ECID) for user session consistency.

  • If using Adobe Launch or DTM:
    Code:

    _satellite.getVisitorId().getMarketingCloudVisitorID();
    
  • If implemented via visitorID.js:
    Code:

    s_c_il[0]._fields.MCMID;
    

5. VisitorAPI.js Version

Check the version of VisitorAPI.js in use for troubleshooting.
Code:

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

6. Concatenated Details

Capture concatenated data like scVersion and segregate its components for clarity.
Code:

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

7. IP Address

Before capturing IP addresses, verify compliance with legal and company policies.

8. User Agent

Track user agents to analyze device and browser usage.
Code:

bagent = navigator.userAgent;

Methods to Capture IP Address or User Agent:

  1. Populate values in the Data Layer and map them to AA variables.

  2. Use processing rules to dynamically capture these values.

Implementing and Testing in Adobe Launch

To test the above configurations, follow these steps:

  1. Navigate to Tags(Adobe Launch) TMS.

  2. Add the Adobe Analytics Extension.

  3. Insert the following code snippet in the custom code section.

  4. Build the version and check results in the browser console.

Sample Code:

// 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);

Final Thoughts

Capturing the right testing and debugging parameters in Adobe Analytics helps identify issues, optimize performance, and maintain data accuracy. By leveraging the above techniques, you can streamline your analytics processes and ensure seamless tracking across your digital ecosystem.

Got more questions about Adobe Analytics implementation? Drop a comment below!

Reply

or to participate.