Google Tag Manager Issue
See original GitHub issueHi,
It’s not clear how can I update Google Tag Manager with barba js? it’s in the <head>
tag right now, but I’ve tried initStateChange instead… But it’s dosen’t seems to work… please help.
Barba.Dispatcher.on('initStateChange', function() { (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-*******'); });
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Troubleshoot issues - Tag Manager Help - Google Support
Troubleshoot issues · Unpublished changes: Make sure that you have published your container. · Wrong trigger configuration: · Triggers too specific: · Unexpected ......
Read more >8 Reasons Why a Tag in Google Tag Manager is Not Firing
A Tag in Google Tag Manager is Not Firing? Quick Summary · Trigger misconfiguration · A blocking trigger is being used · You've...
Read more >5 Common Google Tag Manager Problems | Advance Metrics
5 Common Google Tag Manager Problems and How to Fix Them · 1. Why is my tag firing incorrectly? · 2. Why is...
Read more >5 Ways to Troubleshoot Your Google Tag Manager Installation
1) Write Good Code and Validate Your JavaScript · 2) Use Google Tag Manager's Preview Link to debug in Firefox with Firebug ·...
Read more >How to check if Google Tag Manager is Working - Testing GTM
How to check if Google Tag Manager is Working – Testing GTM · Check the source code of the website · Check using...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
With the recent Google Tag Manager Script I’ve added this code.
The reason I have
document.location.hostname != "localhost" && document.location.hostname != "xcrap.local"
It’s not to track page changes in my localhost environment. And of course you have to have the normal code above </head> in every page.Scripts in the document do not get reevaluated on change. In GTM we created a History Change trigger and have the GA tag set to fire on All Pages and the History Change event.