Blocking/enabling of Google Tag manager with Custom JS does not work correctly
-
Hi! Thanks for this plugin ??
I’m implementing your plugin and add-ons to block cookies on first entering the website (opt-in), and enabling them whenever the visitor accepts or clicks out of the banner. This works well with serveral custom JS scripts and custom Iframes.
However it does not work correctly for Google Tag manager.
This is in the HTML source of the website:
<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-TXL8JC');</script>
I’ve added the URL
//www.googletagmanager.com/gtm.js
to the Custom JS add-on.Problem: The script is now always blocked. Also when the visitor has accepted cookies!
I’ve tried the ‘Asynchronous mode’ option, but now the script is never blocked.
Could you help me out?
Menno
- The topic ‘Blocking/enabling of Google Tag manager with Custom JS does not work correctly’ is closed to new replies.