SPA Archetype w/ Automated adobeDataLayer? | Community
Skip to main content
March 28, 2022
Solved

SPA Archetype w/ Automated adobeDataLayer?

  • March 28, 2022
  • 2 replies
  • 989 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by davidjgonzalezzzz

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/content/jcr_root/apps/wknd-spa-react/components/page/customheaderlibs.html

 

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).

2 replies

kautuk_sahni
Community Manager
Community Manager
December 5, 2023

@fmateen @joerghoh @jagadeesh_prakash @tarunkumar @heidi05 @mohit_kbansal @aanchal-sikka Can you please review this unanswered question? Appreciate your thoughts on this.

Kautuk Sahni
davidjgonzalezzzzAdobe EmployeeAccepted solution
Adobe Employee
December 5, 2023

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/content/jcr_root/apps/wknd-spa-react/components/page/customheaderlibs.html

 

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).