Expand my Community achievements bar.

SOLVED

Google Tag Manager is not being found

Avatar

Level 2

Hello im having problems setting up gtm with adobe AEM, im using AEM with react in a headfull aproach.
I've added the tag in the <head> in the index.html and in the react frontend its identifying the tag:

CarlaOl_0-1731512272128.png

but on publish its not being found, what am I missing?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Since you mentioned that you are using it in headful approach, you need to make sure that GTM libraries are actually included on your AEM page (and not just in index.html. I assume index.html might just be used for local development).

You can once cross check in the network tab on publish instance in developer tools whether they are loading or not.
 

View solution in original post

4 Replies

Avatar

Level 8

Hi @CarlaOl,

can you share the relevant parts of your AEM and React code?

Avatar

Level 5

Hi @CarlaOl 

Try to open index.htm page with a random url query param. Just too see if it shows up. This is to check first if it is a cache issue or not.

 

You can also try to republish the page.

 

Make sure also you actually deployed your project to publish after you made the changed.

 

Try to add some other dummy change along the GTM one and check if that shows up.

 

Come back pls with the results. The aim is to try to isolate the root cause.

Avatar

Correct answer by
Community Advisor

Since you mentioned that you are using it in headful approach, you need to make sure that GTM libraries are actually included on your AEM page (and not just in index.html. I assume index.html might just be used for local development).

You can once cross check in the network tab on publish instance in developer tools whether they are loading or not.
 

Avatar

Level 2

I had to add the tag in customheaderlibs, that worked, thanks!