Analytics
2.6K members online now
2.6K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Google Tag Assistant reporting issues

Follower ✭ ✭ ☆
# 1
Follower ✭ ✭ ☆

Getting errors from Google Tag Assistant on this one site which is setup like many others we've worked on.

 

URL: k m s c (no spaces + [dot]ca)

 

It reports "Non-standard implementation" with a link to this help article. Which reads:

 

Non-standard implementation

We have detected Google Tag Manager web requests, but were not able to find the code snippet on the page.

Using non-standard code implementation on a page may prevent tags from being fired.

Verify that your code snippet is working fine. You can make use of the preview and debug tool to ensure all tags added in Google Tag manager are being fired: https://support.google.com/tagmanager/answer/2695660

 

The analytics code which is inserted via Tag Manager is seen however and Google Analytics is showing website data. So it does work.

 

I have manually coded in the 2 bits of code required for Tag Manager as well as tried using a Wordpress plugin to insert the code with the container ID.

 

At a loss here as to the problem.

 

Anyone have any ideas?

2 Expert replyverified_user

Google Tag Assistant reporting issues

[ Edited ]
Top Contributor
# 2
Top Contributor

Hi :-)
The GTM container code - Im assuming is for GTM-N2WKRG?

The way the tracking code gets installed has changed.. 
This part should now be installed 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-N2WKRG');</script>
<!-- End Google Tag Manager -->

With the following part installed just after the opening <body> tag
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N2WKRG"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

If you log into GTM, the new script code with explanation of installation should be available in the GTM Interface.

Installing the GTM Container code, can be done by adding the code to the active theme's header.php file
in the appropriate places

Bare in mind, if the theme gets updated, then the manual code edits will get overwritten

Also are you using cloudflare or is one of the plugins you using, using cloudflare?
It is changing the opening GTM Container script tag to the following: <script type="text/rocketscript">
Which is likely what is causing the error

From the site source code via browser:

 </div> 
</div> 
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-N2WKRG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script type="text/rocketscript">
         if( !hasWKGoogleAnalyticsCookie() ) {
           //Google Tag Manager
           (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='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
           })(window,document,'script','dataLayer','GTM-N2WKRG');
         }
         </script>



This can be prevented by changing the opening script tag to the following instead: 
<script data-cfasync="false" type="text/javascript>


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

Google Tag Assistant reporting issues

Top Contributor
# 3
Top Contributor

Hi, Jay S,

 

One thing about the GTM implementation is that you have the snippet within a <div> tag. Ideally, the GTM container should not be within any tags and should come either immediately after the opening <body> tag, or, now even acceptable and recommended, as high in the <head> as possible.

 

If you're able to change that, then I believe that should fix the GA Tag Assistant warning. One thing to note is that sometimes there may be issues with the TA itself, and occasionally it reports erroneously, so just be cautious that if you see absolutely nothing wrong, then there just not be anything wrong at all!

 

Hope this helps.

Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: Google Tag Assistant reporting issues

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

The way the tracking code gets installed has changed..
This part should now be installed before the closing </head> tag
...
With the following part installed just after the opening <body> tag

Yup had done all that.

If you log into GTM, the new script code with explanation of installation should be available in the GTM Interface.

Yup. That's where I got the code from.

Also are you using cloudflare or is one of the plugins you using, using cloudflare?

Yes but Rocketloader is disabled for the domain with CloudFlare's control panel because it's known to cause problems. Hmmm!

This can be prevented by changing the opening script tag to the following instead:
<script data-cfasync="false" type="text/javascript>

This is a good clue! Will investigate further. Thanks!

Re: Google Tag Assistant reporting issues

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

One thing about the GTM implementation is that you have the snippet within a <div> tag. Ideally, the GTM container should not be within any tags and should come either immediately after the opening <body> tag, or, now even acceptable and recommended, as high in the <head> as possible.

Currently it's being inserted via this Wordpress plugin. Which we decided to try since our hardcoded version wasn't working properly.

If you're able to change that, then I believe that should fix the GA Tag Assistant warning.

That would be putting things back how I had them before which didn't work either. (sigh)

One thing to note is that sometimes there may be issues with the TA itself, and occasionally it reports erroneously, so just be cautious that if you see absolutely nothing wrong, then there just not be anything wrong at all!

Gah. The OCD freak that I am doesn't like the thought of that at all.

Google Tag Assistant reporting issues

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

As it turns out... there were 2 spots within CloudFlare where RocketLoader could be turned on. It was off in one place but on in another.

 

It looks like this problem is solved now. Thanks folks.

Google Tag Assistant reporting issues

Top Contributor
# 7
Top Contributor

Thanks for the update, happy to hear you have resolved the issue

Thanks

Bronwyn :-)

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