'Google Tag Manager Broken In Prod
I have been using GTM with GA4 for a few weeks now without much issue to track various metrics on my companies website. I have had GTM and GA4 working in the past locally, in our dev environment, and within our prod environment. After pushing updates from dev to prod, GTM has broken and will not connect to the prod website. The only error that I get is a 404 that GTM could not load. The same code is working locally, as well as on the dev site, this error only occurs on prod. I know my GTM is published, but I don't know why it has broken our prod site. I can't find many related answers that don't just say "publish your tag manager".
I have checked and rechecked the dev and local sites. I have checked that GTM is published. It is only within prod that I get the 404 error while connecting to googletagmanager.com.
Solution 1:[1]
yes, usually you get a 404 when the container is not published.
In your case, however, it may be something like forgetting to include the GTM script in your CSP.
Make sure you have the correct GTM id in your code.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | BNazaruk |
