Request tags in GTM containers (Google Tag Manager) under turbopumps

Has anyone figured out how to get the Google Tag Manager container to run all of its tags in Turbolinks?

I run the rails 4.0 application (with Turbolinks) and put the code below in the footer that I display on each page (inside the tags):

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

(where XXXXX is my GTM container identifier)

Unfortunately, it does not start a single tag when I browse the pages (I suppose due to Turbolinks). However, everything works fine if I refresh the page I'm on.

I saw people post questions about workarounds for Google Analytics tags that seemed to solve this problem, but never for a full GTM container. Help? Is anyone

+2
1

GTM Turbolinks : Googletagmanager with Turbolinks

, GTM script <body>.

0

All Articles