Expand my Community achievements bar.

SOLVED

SPA Archetype w/ Automated adobeDataLayer?

Avatar

Level 1

One of the great benefits of using the AEM archetypes is that they're already setup at the component level to update the adobeDataLayer, but that doesn't seem to be the case when going through  the WKND SPA example.

 

Does anyone know if there is a convenient way to modify the setup to automatically populate the adobeDataLayer without having to re-write the sling model for all of the SPA components?

 

Thank you,

J

1 Accepted Solution

Avatar

Correct answer by
Employee

To populate page-level data attributes you could write Javascript that writes values into the DDL in yourcustomheaderlibs.html

Ex. https://github.com/adobe/aem-guides-wknd-spa/blob/React/integrate-spa-solution/ui.apps/src/main/cont...

 

In terms of component DDL, youd need to do this in your SPA app getting the data attributes you need from either OOTB values of your model.json or some other custom approach (depends on what all data you want).

View solution in original post

2 Replies

Avatar

Administrator

@fmateen @Jörg_Hoh @Jagadeesh_Prakash @TarunKumar @Heidi05 @Mohit_KBansal @aanchal-sikka Can you please review this unanswered question? Appreciate your thoughts on this.



Kautuk Sahni

Avatar

Correct answer by
Employee

To populate page-level data attributes you could write Javascript that writes values into the DDL in yourcustomheaderlibs.html

Ex. https://github.com/adobe/aem-guides-wknd-spa/blob/React/integrate-spa-solution/ui.apps/src/main/cont...

 

In terms of component DDL, youd need to do this in your SPA app getting the data attributes you need from either OOTB values of your model.json or some other custom approach (depends on what all data you want).