Hi, I am currently using the Adobe Client Data Layer to collect my page data. I am able to see the collected data when I type "window.adobeDataLayer", but when I use "adobeDataLayer.getState()", it shows me an empty array without any page data:
I know that is because I used the following method to pass the data to adobeDataLayer, instead of the push method (adobeDataLayer.push()):
So I am quite confused, since using this method I am able to see the collected data when "window.adobeDataLayer", but not "adobeDataLayer.getState()", what are the differences between these two? And is this the right way to store the data in adobeDataLayer? Is it a must to use the adobeDataLayer.push() method?
Any insights would be greatly appreciated!
Solved! Go to Solution.
Views
Replies
Total Likes
There is a script that needs to be installed to use ACDL. That script modifies the adobeDataLayer array's push() method, so that ACDL is able to set-and-update values within its own internal, computed data layer, and so that getState() can return what you expect it to.
So the simple solution is: always use push(), don't use any other JavaScript array methods, e.g. setting adobeDataLayer[0].
There is a script that needs to be installed to use ACDL. That script modifies the adobeDataLayer array's push() method, so that ACDL is able to set-and-update values within its own internal, computed data layer, and so that getState() can return what you expect it to.
So the simple solution is: always use push(), don't use any other JavaScript array methods, e.g. setting adobeDataLayer[0].
Hi Yuhui,
Thank you for your answer!
Views
Replies
Total Likes
Views
Like
Replies