I have an issue in Launch accessing the AEM data layer. The some of the data elements are not being populated. Here's the DL object:
I added pageName to a data element and pageTemplateName to another one, but they are not being populated. I tried a "direct" approach:
return window.adeptDataLayer.getState().page.pageInfo.pageName;
I got this error message:
Cannot read property 'pageName' of undefined TypeError: Cannot read property 'pageName' of undefined
I tried various ways to convert the object to text but it didn't solve the problem. Currently the s.pageName variable is populated by this other data element but it's pulling the wrong object:
var tx = adeptDataLayer.getState().page;
for (var key1 in tx){
var myPage="";
myPage=tx[key1]["dc:title"];
}
return myPage;
I tried changing the "dc:title" element to "pageName" but that also gave me the type error.
What should I try?
Solved! Go to Solution.
Views
Replies
Total Likes
@ZombieLor Can you try executing the below in console ?
window.adeptDataLayer.getState().page[1].pageInfo.pageName
Views
Replies
Total Likes
@ZombieLor Can you try executing the below in console ?
window.adeptDataLayer.getState().page[1].pageInfo.pageName
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
By "AEM data layer", I assume that you're referring to the Adobe Client Data Layer.
Since you're using Adobe Launch, you can install the Adobe Client Data Layer extension to help you with your operations. In your case, you'll want to create a data element based on the data layer's computed state.
By the way, if this is really the Adobe Client Data Layer, you're advised to keep the data layer's name as "adobeDataLayer". Changing it can cause things to break.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies