DTM Injecting JS Code on AEM Web Pages for Analytics Integration | Community
Skip to main content
AEM_Forum
Level 10
October 10, 2017
Solved

DTM Injecting JS Code on AEM Web Pages for Analytics Integration

  • October 10, 2017
  • 1 reply
  • 776 views

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.

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 jantzen_b

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

1 reply

jantzen_b
Adobe Employee
jantzen_bAdobe EmployeeAccepted solution
Adobe Employee
October 10, 2017

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