GA4 Debugview staging issue - google-tag-manager

I'm trying to get GA4 e-commerce working for a client. For some reason though I cannot get the testing environment to send data over to any GA4 property. The preview and DebugView work just fine with the production website but the second I change the address in preview to the staging website nothing gets picked up anymore in GA.
The container shows in preview that it's installed correctly, you can see the events trigger like normal in GTM and when you open the tag it shows the correct measurement ID.
I created a new testing property to try and see if that made a difference, it didn't. It still only shows the events from the production site, not staging.
Tag assistant shows that the container is properly loaded on staging.
Anyone has any clue what i should be looking at? Any help would be greatly appreciated.
thanks

Double check that you're not inadvertently running AdBlock or have Firefox configured to block marketing tags. Either would result in the GTM Preview indicating conditions met and tag fired, but the browser could be prevented from actually sending the data.
Alternatively, check that your GA account/property doesn't have a filter engaged that's preempting the data from being processed in GA.

Related

Google Tag Manager not collecting data when deployed to Vercel (Next js)

I am trying to use Google Tag Manager to collect event data (including page view) but it isn't feeding through to Google Analytics once its deployed to Vercel.
I have checked the following things:
GTM has a GA4 Configuration Tag with the measurement ID from GA
I have set up the GTM measurement ID as a public variable in env.local (and reflected this in Vercel)
T have added the script to _app.js
I have added the iframe to _document.js
Set up the tags required in GTM and published it
Using dev tools I have checked that the gtm script (with the correct reference) is fired in the Network tab
Also checked dataLayer in the Console tab is collecting the data expected
However, in spite of all of this I can't see any data in Google Analytics. Played around a bit yesterday expecting to see some today but nothing.
It seems to work on localhost and checking both in real time Vercel doesn't register a view but localhost does.
Previewing the Vercel URL from GTM does say its connected and I can view that in real time in GA when going this way, but if I go to the address directly it's not logging it. Checking 'Tag Coverage' on GTM also says the pages aren't connected.
Am I missing something? It seems to work in theory, just not in practice when visiting the Vercel address directly (as opposed to via GTM preview)?
Thank you in advance
I think I found an answer myself and it's rather basic. It seems a pop up blocker I had installed ('Pop up blocker for Chrome™ - Poper Blocker') was preventing it from firing. Disabling the extension seems to have done the job.

Google Tag Manager on localhost

I was asked to implement the Google Tag Manager scripts into the React application. I've added the scripts to head and body of my html file. I've tested the site in the Preview mode of GTM and everything seems to working fine. Clicks and route changes are tracked correctly.
I have one doubt... What about the localhost development ? Is it going to generate unnecessary logs on the analytics (which I have no access to)? Or maybe it's just enough to paste the snippets and that's it?
I can't find an answer so that's why I decided to ask here.
If someone has some experience on that topic - please let me know :)
I would advise you to map separate Google Analytics property IDs by either a datalayer variable, URL or custom JavaScript to return a separate property ID based on whether users are accessing your website from either your localhost development environment, your UAT environment (if any) and then your production environment (or others as applicable).
Essentially you're looking at having something that says "if the URL contains "localhost", return my development property ID", then use this variable name in your Google Analytics tag(s) instead of a static value.
Yes, unfortunately all your existing testing is all in your profile because if you had the production property ID configured and fired off a bunch of events and pageviews, it absolutely collected and sent there as part of the debugging experience. Generally though, that's a low concern on a production app because you make up such a small portion of overall traffic; you're just a couple of blips in the larger dataset.

Google Analytics (or Tag Manager) stuck in debug mode

I am using GTM with Google Analytics and I can't get out of debug mode. I am not in GTM "Preview" mode and don't have the GA debugger extension installed. It's happening on all browsers - for everybody. Every page load dumps dozens and dozens of lines in the console like this:
I have checked all the settings I can think of both on GA and GTM. All the tags on GTM that use analytics have the debug set to false, and debugging by default is not checked for the environment (screenshots).
I am kind of frustrated and also concerned that this is slowing site browsing.
Any help appreciated.
Follow-up - I already suspected this, but it appears that GTM is the culprit. It's loading analytics_debug.js instead of analytics.js (despite there being no obvious setting set to debug).
I have another site that uses analytics directly (not through GTM), and it does not have this problem.
Well, turns out I did have a tag that had "use debug version" set to "true". I thought I had checked all the tags, but I hadn't noticed that there is now a 2nd page.

Analytics not working in Chrome App

I am trying to add Google Analytics to a Chrome App using the google-analytics-bundle.js library found here. Apart from the example in the bundle itself I also tried this sample with no success.
Note that the tracking ID in both tests was been replaced to my own property id, which has already been used successfully before with a separate website.
Here's a screen shot which shows the details of the request and the data being sent:
Since you said that the same tracking ID works on a website, it probably means that you have a wrong kind of tracking ID.
From the Wiki of the library:
Prerequisites
[...]
get a Google Analytics "App" tracking property.
There are 2 types of properties, selected at property creation: "Website" and "Mobile App". You need the second type to work in a Chrome App.

google analytics pixel is firing but no results

I am tracking my application with Google Analytics Universal Analytics, I had implemented a code into my web site, and into my desktop application using POST web requests.
Everything works fine in last Wednesday(20.11.13), and I could see the results in the real-time report. But today(24.11.13) the real time reportstopped showing results.
I had tryed to debug it with fiddler, and the pixels seems to fire correctly, so my questions are:
how do I check that Google Analytics actually accepted the tracking request? does 200 header response is good enough?
Do you know if Google had changed their API?
Do you know if they have problems with their real time report? (my other real time reportis still working so I don't think this is the reason)
Thanks!!
OK, If anyone encountered this weird issue, the solution is wierder.
My production GA works fine but all the test one stopped working, the solution was toopen a new GA account and point my GA pixels to this account.
I believe they have a glitch or they blocked my test accounts.
Try using Omnibug for Firefox or GA Debug for Chrome. They will tell you weather your measuring tags fired successfully or if there was an issue.
I am attaching a screenshot of Omnibug -- it lists all the tags fired on any given page:

Resources