Google Tag Manager is not being found | Community
Skip to main content
Level 2
November 13, 2024
Solved

Google Tag Manager is not being found

  • November 13, 2024
  • 3 replies
  • 1021 views

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:

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

Best answer by h_kataria

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.
 

3 replies

daniel-strmecki
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
November 13, 2024

Hi @carlaol,

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

Tethich
Community Advisor
Community Advisor
November 13, 2024

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.

h_kataria
Community Advisor
h_katariaCommunity AdvisorAccepted solution
Community Advisor
November 14, 2024

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.
 

CarlaOlAuthor
Level 2
November 14, 2024

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