Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.
SOLVED

DTM Injecting JS Code on AEM Web Pages for Analytics Integration

Avatar

Level 10

Hi all,

If we need to Inject JS Code on AEM Web Pages for Analytics Integration, do we do it on templates or components or both?

I agree that DTM is a good tool for this.

Even if we use DTM, where will it inject?

If we are able to do it only on templates, the effort will be less.

Also, will it be the same JS code on all pages?

Appreciate all your responses.

Thanks,

Rama.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Rama,

For DTM, any non-Adobe JS code would be placed in the third-party section within a tool or rule. Where you decide to place the code will determine if it is loaded on every page or a limited set of pages.

If you'd like it to load on every page, you could place the code in one of the tools or create a page load rule without conditions that would fire on every page. Otherwise, you could use conditions to limit where the code would be placed on your site.

Thanks,
Jantzen

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Hi Rama,

For DTM, any non-Adobe JS code would be placed in the third-party section within a tool or rule. Where you decide to place the code will determine if it is loaded on every page or a limited set of pages.

If you'd like it to load on every page, you could place the code in one of the tools or create a page load rule without conditions that would fire on every page. Otherwise, you could use conditions to limit where the code would be placed on your site.

Thanks,
Jantzen