Dynamically Populate Value In dataLayer

While checking about dataLayer I came across: https://www.optimizesmart.com/google-tag-manager-data-layer-explained-like-never/

Example of dataLayer

On any web page test yourself by pasting the code

1.Paste the following code


  var dataLayer = {

‘pageName’: document.title,

‘pageURL’: document.URL



You can check these in console via

  • dataLayer.PageName
  • datLayer.pageURL

2.If you paste the following:


dataLayer = [{

‘pageCategory’: ‘Statistics’,

‘visitorType’: ‘high-value’



You can check these in console via

  • dataLayer[0].pageCategory
  • dataLayer[0].visitorType

3.If you paste the following :


dataLayer = [{

‘pageCategory’: ‘Statistics’,

‘visitorType’: ‘high-value’






You can check these in console via

  • dataLayer[0].pageCategory
  • dataLayer[0].visitorType
  • dataLayer[1].nameA
  • dataLayer[1].nameB



digitalData.page = {};

digitalData.page.pageInfo = {};

digitalData.page.pageInfo.pageName = “Electronics>Computers>MacbookPro:ProductDetails”;













Please let me know if you have any question by your comment in the comment section.

How To Clear JAVA cache Of Computer

To clear your Java cache in Windows:

  1. Click Start > Control Panel.
  2. Locate and double click the Java icon in the Control Panel.
  3. Click Settings under Temporary Internet Files.
  4. Click Delete Files.
  5. Select all boxes and click OK on Delete Temporary Files window.
  6. Click OK on Temporary Files Settings window.
  7. Click OK to close the Java Control Panel.

To clear your Java cache in Mac OS X:

  1. Double click your Mac hard drive.
  2. Double click Applications.
  3. Double click Utilities.
  4. Double click Java Preferences.
  5. Click the Network tab.
  6. Click the Delete Files… button.
  7. You are prompted to delete your temporary files for Java. Make sure all boxes are selected with check marks. Click OK.
  8. Close the Java Preferences window.

How to track the amount of time between two different Adobe analytics events

In order to track the amount of time between two different events you can use the getTimeBetweenEvents plugin. It allows you to track the amount of time between two different Adobe analytics events.

I believe this plugin is not free , to get this you need to get in touch to Adobe Consulting.

In case you are not willing to work with Adobe Consulting then you can develop your own custom solution.

You can set a cookie when the first event is fired, in that cookie set the time stamp as t1 and when the second event fire set the timestamp as t2. Calculate the time difference between t1 and t2 and populate the value analytics variable.

Uploading Data through data source using Adobe Analytics API 1.4

This is to test that what happen to data sources FTP location when data source data is uploaded through API 1.4 using postman

1.Create the data source through Analytics UI

  • Login to SC 15
  • Click on Admin->Data Sources

2.Create Transaction ID data sources

3.Using Postman send POST request on https://api.omniture.com/admin/1.4/rest/?method=DataSources.UploadData

4.In Pre-request Script

var uuid = function() {};

uuid.v4 = function() {

    return ‘xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx’.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == ‘x’ ? r : (r&0x3|0x8); return v.toString(16); });


var WSSE = function(username, secret) {

    this.username = username;

    this.secret = secret;


WSSE.prototype.getHeader = function() {

    var nonce = uuid.v4();

    var created = new Date().toISOString();

    var hashString = nonce + created + this.secret;

    var digest = CryptoJS.SHA256(hashString).toString(CryptoJS.enc.Base64);

    var b64nonce = CryptoJS.enc.Latin1.parse(nonce).toString(CryptoJS.enc.Base64);

    var header = “UsernameToken”;

    header += ” Username=\”” + this.username + “\”,”;

    header += ” PasswordDigest=\”” + digest + “\”,”;

    header += ” Nonce=\”” + b64nonce + “\”,”;

    header += ” Created=\”” + created + “\”,”;

    header += ” Algorithm=\”SHA256\””;

    return { ‘X-WSSE’: header };


var wsse = new WSSE(‘shared secret’, ‘password’);

postman.setEnvironmentVariable(“x-wsse”, wsse.getHeader()[‘X-WSSE’])

5.Under body


  “columns”: [






  “dataSourceID”: “2”,

  “jobName”: “Product returned”,

  “reportSuiteID”: “lscsgeekourpc”,

  “rows”: [









6.Under Header set WSSE


For API 1.4 documentation check : https://github.com/AdobeDocs/analytics-1.4-apis

Note :Grab the data source ID from the URL when you open the data source in UI

Once it appears true as result than in FTP of Data source a SOAP folder is created which have a file of data source, later on, which process.

Processing pauses if the size exceeds 50 MB and does not resume until the total is below 50 MB. To limit delays in generating reports, do not upload more than 90 days of data per day.

Reference : https://marketing.adobe.com/resources/help/en_US/sc/datasources/datasrc_faq.html