GA Preview Says Tags are Working on Ngrok But Not on Production?

28 views Asked by At

I have a react web app. I installed GA tags using the npm package, react-gtm-module. I put the app up on ngrok and tested it in GA on preview mode. Everything worked great. The Google Analytics tag was detected.

Then I pushed the same code to production, and GA preview mode says, "Google Tag: GTM-##### not found".

What am I missing?

Note: The build tool is Meteor - I don't think that's relevant but I'm noting it here for completeness.

UPDATE

I added the gtag.js script to the home page and it seems to be working in production now. But, I thought react-gtm-module was supposed to add gtag.js for me. Is that not so?

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script>
<script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());

    gtag('config', 'GTM-XXXXXXX');
</script>
1

There are 1 answers

0
VikR On

It was a misconfiguration of the specs for Google Ads / Google Tag Manager. That U/X is a mess.