Analytics
4.6K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
 
Guide Me
star_border
Reply

Google Analytics stopped working

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

It was only recently that my analytics stopped working on my website, gamingcontrollersforyou.com (a wordpress site). My tracking ID is UA-64318409-1, and is in a Google Tag Manager container. I've confirmed on GAChecker my ID is correct, though, but the Tag doesn't fire "pageview" (I've checked through Google Tag Assistant on Chrome as well). It apparently stopped working in mid-May but I wasn't aware (and I'm fairly certain I'm still getting traffic as I've gotten conversions from my site).

 

I've resubmitted my sitemap on all four versions of how I want my site to be searched (http/https versions with and without the "www"), and even cleared cache on my plugins and CDN (cloudflare). Also, the theme I'm using provides option to either use Analytics code or a GTM container for tracking data.

 

Any assistance is appreciated.

1 Expert replyverified_user

Re: Google Analytics stopped working

Top Contributor
# 2
Top Contributor

Hi :-)

Sitemaps have nothing to do with analytics tracking. If you have questions regarding indexing, crawling, sitemaps, or general SEO, then best place to ask is the Webmaster Central Help Forum

https://productforums.google.com/forum/#!forum/webmasters

From checking your site via browser, Im not seeing any GTM container code as being installed on the website

I'd try adding the container code.. make sure your GA tag is setup correctly when you preview it in GTM preview

then publish the container.

You should start to see data within about 24hrs if all installed correctly

 notag.png

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Google Analytics stopped working

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thanks for the feedback. I did a bit of digging this evening and here's what I found:

 

The GTM Container that I created (GTM-PSJDCB2) is implemented and contains a tag that fires Universal Analytics on PageView using my Analytics tracker ID. GTM container is inserted via non-traditional means (through my Wordpress Theme).

 

I went to check if there was any place that CloudFlare may have been messing up the GTM installation code that was generated from my theme (I had read in another thread here that Rocket Loader embeds a script that messes things up) and made sure it was disabled in all applicable places (within my instance of W3 Total Cache and from my hosting).

 

I also tried using a TagManagerInjector extension from Chrome to inject my GTM container and GA ID into a data layer on a browser window to check if I had both GTM container and GA ID right - Tag Assistant confirmed that my implementation was right (and even brought up GTM's preview and debug pane). Upon inject, I saw real-time analytics running all of a sudden (until I had switched stopped the inject).

 

I did find that while checking the console with my website open, there were "Mixed Content" errors requesting scripts to be served as HTTPS (and were blocked). Makes me wonder if these errors are causing my Analytics to stop working?

 

Will go check with my theme developer.

Google Analytics stopped working

[ Edited ]
Top Contributor
# 4
Top Contributor

Hi :-)

the GTM container code should still come up as being present on the site.

Lots of ppl i know use GTM with WP.

 

eta its my understanding the TagManagerInjector extension from Chrome is for testing your container/tag setup

without having GTM installed on the website itself.

I'm sure your container and GA tag are correct however im not seeing any indication of the GTM container code as

being installed on your site.. not via Google Tag Assistant or via the network tab in Chrome Dev Tools

 

Did you clear the cache for W3 total cache after adding the GTM container code?

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Google Analytics stopped working

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi Smiley Happy

 

Yes, I did clear W3 total cache after adding the GTM container code - I even checked the page source and this appears in the <body>

 

<iframe src="//www.googletagmanager.com/ns.html?id=GTM-PSJDCB2" height="0" width="0" style="display:none;visibility:hidden"></iframe>

 

What else could I be missing?

Re: Google Analytics stopped working

[ Edited ]
Top Contributor
# 6
Top Contributor

What else could I be missing?

The script tag part of the container code that gets inserted before the closing </head> tag

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-PSJDCB2');</script>
<!-- End Google Tag Manager -->

 

The iframe code that you posted gets placed just after the opening <body> tag, and is in noscript tags.. 
so only runs when javascript is disabled.

and as you stated, you do already have this part of the code 

copy/paste from your source code:

<body class="home page-template page-template-page-home page-template-page-home-php page page-id-883">
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-PSJDCB2" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script></script> <header>

https://developers.google.com/tag-manager/quickstart

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here