0
votes

I have Google tag manager tag inserted on all pages on the website.

head:

<!-- 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-XXXXX');
</script>
<!-- End Google Tag Manager -->

At the end of body:

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

On homepage and four other pages on website, this code works OK

On those pages, gtm head element (I suppose), creates two new lines above him.

<script type="text/javascript" async="" src="https://www.google-analytics.com/analytics.js"></script>
<script async="" src="https://www.googletagmanager.com/gtm.js?id=GTM-XXXXXX"></script>

But on two remaining pages, only one line is created

<script async="" src="https://www.googletagmanager.com/gtm.js?id=GTM-XXXXXX"></script>

I went deep in that gtm.js file and found:

if (!Ck) {
               var Z = a[oc] ? "u/analytics_debug.js" : "analytics.js";
               a[kd] && !a[oc] && (Z = "internal/" + Z);
               Ck = !0;
               r(L("https:", "http:", "//www.google-analytics.com/" + Z, u), function() {
                   x[l()].loaded || d()
               }, d)
           }

That returns false, and don't do that part of code. So, I don't have analytics on that page.

Chrome extension "Google Tag Assistant" gives me this notification:

This page did not send a hit, but other recorded pages on the same domain did send hits. Most likely, this page was not properly tagged with the Google Analytics tracking code

In the end, to mention, I don't have access to that Google account, I only got tracking codes for GTM and analytics.

1
It's really hard to say from the limited information, but it looks like the trigger for you GA tag does not fire on that page (or there is a blocking trigger). You should put GTM in debug mode, that will display debugging output at the bottom of your page that shows if the tag is fired. If you do not have access to that GTM account you need to ask the account holder. You won't be able to solve this without looking at the GTM configuration.Eike Pierstorff

1 Answers

0
votes

If the tracking code for Google Analytics should fire or not is set within the GTM interface. If, for some reason, there is a blocking trigger set to not fire Analytics on those pages, that is the most likely reason. It is basically impossible to answer your question without access to the configuration itself or more information from the GTM account and the way it is set up.