• Resolved mirash

    (@mirash)


    Hi,

    I have just been notified that the website delivers cookies before the user gives their consent (analytics, tag manager).
    Can I set those not to be delivered until the user has given their consent via Complianz?

    Thank you,
    kind regards,
    Mira

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Aert Hulsebos

    (@aahulsebos)

    Hi @mirash,

    Yes. Currently you have added the UA code with Complianz. This is fine, but you need to change something in the below code;

    <script async src=”https://www.googletagmanager.com/gtag/js?id=UA-156555122-2″></script&gt; <script>window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘UA-15**55122-2’);
    gtag(‘config’, ‘AW-***12’);</script>

    Both are now added before consent, to change this please follow this article;

    https://complianz.io/adding-global-site-tag-gtag-js-with-granular-consent/

    Because Analytics can be set under Statistics, and Ads Remarketing only after Marketing you should split the two scripts, as shown in the article.

    Let me know if you need any help,

    regards Aert

    Thread Starter mirash

    (@mirash)

    HI Aert,

    thank you for your answer. Sorry, you said to let you know if I need any help… I don’t fully understand the article you sent. Where do I add the code? And do I have to fill out the numbers that are now ** in the code you sent?
    Also, I have seen that there is currently also an analytics code in the header-footer-plugin. Do I remove that? Or do I remove it from Complianz?

    Thank you very much,
    kind regards,
    Mira

    Plugin Author Aert Hulsebos

    (@aahulsebos)

    Hi @miras,

    Can you post the code from the header/footer plugin?

    I will change it and post it here, so you can put it in the plugin again,

    regards Aert

    Thread Starter mirash

    (@mirash)

    Thank you so much! Have I mentioned that I love your support?

    <!– Global site tag (gtag.js) – Google Analytics –>
    <script async src=”https://www.googletagmanager.com/gtag/js?id=UA-156555122-2″></script&gt;
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘UA-156555122-2’);
    gtag(‘config’, ‘AW-754441312’);
    </script>

    Plugin Author Aert Hulsebos

    (@aahulsebos)

    Hi @mirash,

    You can replace it with the below code.

    After, please go to the Complianz wizard, -> Cookies -> Statistics and answer “Yes, and the personal data is available to us”

    Save & Done

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async type="text/javascript" class="cmplz-native" src="https://www.googletagmanager.com/gtag/js?id=UA-156555122-2"></script>
    
    <script type="text/plain" class="cmplz-stats">
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'UA-156555122-2'); 
    </script>
    
    <script type="text/plain" class="cmplz-script">
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'AW-754441312');
    </script>
    Thread Starter mirash

    (@mirash)

    Hi, thank you very much. This seems to work.

    So sorry to have to bother you more, but I have the same problem on our other site and have tried to use your code by modifying it with the correct analytics code, but I am still getting that warning.

    <!– Global site tag (gtag.js) – Google Analytics –>
    <script async type=”text/javascript” class=”cmplz-native” src=”https://www.googletagmanager.com/gtag/js?id=UA-156555122-1″></script&gt;

    <script type=”text/plain” class=”cmplz-stats”>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());
    gtag(‘config’, ‘UA-156555122-1’);
    </script>

    <script type=”text/plain” class=”cmplz-script”>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());
    gtag(‘config’, ‘AW-754441312’);
    </script>

    This site also has a google tag manager code in the header php.
    <!– 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-KLZBKXK’);</script>
    <!– End Google Tag Manager –>

    Is that the problem ?

    Thank you very much, kind regards!

    Plugin Author Aert Hulsebos

    (@aahulsebos)

    HI @mirash,

    Yes, that seems to be the reason for the notice,

    It sees two different googletagmanager.com URL’s. This is not a problem really, but because you have Google Tag Manager, I can imagine it being more efficient to serve the other scripts with Tag Manager as well.

    To do this with Complianz, you can;

    1. Add the GTM code in Complianz, under Cookies – Statistics
    2. Remove the above codes, from GTM and Analytics.
    3. Add the tags to GTM, and trigger them with a custom event, as explained here. https://complianz.io/definitive-guide-to-tag-manager-and-complianz/
    4. Add a statistics category under Cookie Banner Settings – Opt-in – Categories.

    Hope this helps,
    regards Aert

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘delivering Cookies before consent?’ is closed to new replies.