Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

DTM Injecting JS Code on AEM Web Pages for Analytics Integration

AEM_Forum
Level 10
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
jantzen_belliston-Adobe
Correct answer by
Community Manager
Community Manager

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
jantzen_belliston-Adobe
Correct answer by
Community Manager
Community Manager

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