Skip to main content

Cookies/scripts not loading until reloading page

Answered

Comments

10 comments

  • Martin Iv. – vConnect

    Hey Rene,

    Could it be that you have manual installed Cookiebot on your website  AND via GTM too? If you do both, the script will be loaded twice and that can cause some issues. So please check that the script is only present once.

    The GTM implementation guide that we have does not produce this issue - all the scripts that have been marked up are executed immediately when the user clicks OK on the banner (of course executed only if the user has given a consent to that particular category of cookies).

    Regards,
    Martin

    0
  • Rene

    Hi Martin,

    I am sure and just checked it again: There is no cookiebot on our page - it is only in GTM.

    Do you have another idea? It seems, that people quite often have that problem... Is your installation-example really coorect or do I need that: https://www.tagmanageritalia.it/how-to-fix-cookiebot-official-guide-and-protect-yourself-from-gdpr/

     

    If possible I would like to use the official cookiebot-installation.

     

    THANK YOU

    Rene

     

    0
  • Martin Iv. – vConnect

    Hi Rene,

    This may be caused by some mis-configuration in GTM. Please double check and follow the steps in the GTM instalation guide:
    https://support.cookiebot.com/hc/en-us/articles/360003793854-Google-Tag-Manager-deployment

    Please note: If your existing trigger is of the event type "Page View", you need to change it to event type "Window Loaded" since the visitor's consent is not available to GTM before the window has loaded."

    Kind regards

    0
  • Rene

    Dude... i did that - several times :-(

    0
  • Rene

    Thank you Martin for your nice help, after sending screenshots via email.

    Problem is solved by adding that to cookiebot-tag in GTM:

     

    function CookiebotCallback_OnAccept() {                                 

      if (Cookiebot.changed)

      {

         document.location.reload();

      }

    }

     

    best wishes and thanks again

    Rene

    0
  • Regina Oswald

    I tried to integrate the script in my website, because I don't integrate it in GTM (there are Cookies not set in GTM).

    <script type="text/javascript">
    function CookiebotCallback_OnAccept() {
    location.reload();
    }
    </script>

    But there is a endless loop of relaod.

    0
  • Kasper H.

    Hello Regina.

    Thank you for your post.

    I will recommend creating a support ticket with the specific issue and the domain in question, so we can take a further look at the issue.


    0
  • Regina Oswald

    Hi Kasper,
    I get the tipp from Cookiebot Support to use the function in this form:

    function CookiebotCallback_OnAccept() {
     Cookiebot.changed && document.location.reload();
    }

    And now, the page reloads once.

    0
  • Daniel Wolf

    If you happen to land on this page from a Google Search, here is how we solved this issue without reloading the page:

    Cookiebot Support pointed out that a script on our page was using document.write which in turn messed up the script execution order and introduced the problem that Cookies are only set after a full page reload.

    We identified the script using document.write and removed it, which solved the problem with Cookies not being set instantly.

    0
  • Pablo Thiermann

    Could any of you maybe point me further into a direction of where to insert one of the scripts posted here? In Google Tag Manager, I opened the code of the Cookie Bot template, but I have no idea what to do next. That would be so helpful! 

    0

Please sign in to leave a comment.