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.