Reputation: 13
I set up Google Analytics Tag Manager to track PDF clicks on my site. When I use preview mode on the site, it says the correct tag fires on the page. It looks like it's doing what it is supposed to, but in Google Analytics no event shows up anywhere. I also checked Events (Last 30 Min) but nothing showed there either.
I do not have an internal traffic filter for this. Google Tag Assistant Chrome Extension's tag analysis only showed that the Google Analytics UA has a non-standard implementation. I have verified that the code is installed on the website and has the correct GTM-XXXXXXX number.
Code that was added to the 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-5377XP7');</script>
<!-- End Google Tag Manager -->
Code that was added to the body:
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5377XP7"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
Tag Manger settings:
Track Type : Event
Category: News
Action: Select
Label: PDF
Google Analytics Settings : {{Google Analytics Settings}}
Trigger Configuration:
Trigger Type: Click - Just Links
Wait for Tags
Page Url: contains/
Cluck URL: contains .pdf
References to this trigger: UA - Event - PDF Click (name of the above event)
Debugger gave one error that said:
Tracking ID not set. Aborting hit.
Upvotes: 0
Views: 3162
Reputation: 1336
1.Make sure enter GA tracking Id correctly (google analytics traking id).
2.Save and click on refresh
3. Refresh your site and test again
Upvotes: 0
Reputation: 146110
I had exactly the same message when trying to set up Google Tag Manager with a lookup table.
I have a simple setup, and I just wanted to vary the Analytics ID by hostname.
Somewhere along the line nothing was getting passed, despite having a default value configured.
A fun debugging trick is to add a Custom HTML
tag and then you can put all your variables in a console.log
statement. It even autocompletes for you!
<script>
console.log('GTM Debug - {{Page URL}} - {{Hostname_TO_Analytics_ID}}');
console.log('GTM Debug Analytics', {{Google Analytics}});
</script>
Note that you can put {{ VariableName }}
without quotes when it is an object (like {{Google Analytics}}
is - and you'll get a nice expandable item in the console.
It turned out for me I think to just be a caching issue - and I actually did have things correct.
So...
Important: Sometimes your old tag gets cached
Upvotes: 0