• Resolved Menno Luitjes

    (@mennolui)


    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

    https://www.ads-software.com/plugins/ginger/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Menno Luitjes

    (@mennolui)

    Hi again.

    Just wanted to let you know that I was able to avoid/fix this behaviour by moving the Google Tag Manager script to just below the opening body tag. From somewhere near the closing body tag, where the DuracellTomi’s Google Tag Manager plugin inserts it by default.

    Now my Google Tag Manager is correctly blocked, and enabled.

    Best,
    Menno

    Plugin Author manafactory

    (@manafactory)

    Thank’s for your feedback

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Blocking/enabling of Google Tag manager with Custom JS does not work correctly’ is closed to new replies.