• Resolved donmiat

    (@donmiat)


    We installed the cookiebot plugin, we noticed that it sporadically generates a blank page after clicking on “Allow All Cookies”.

    This behaviour is sporadic, sometimes it works and everything is fine, but every now and then the white screen appears. Refreshing the page removes the blank page and the website is functional again.

    We are on the lates WP version, php 7, appache/nginx. All plugins are up to date.

    Anny suggestion how to fix this, anybody else experiencing this?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi donmiat,

    If the script tag is using the deprecated JavaScript function “document.write” it might cause the problem you have described above because using this function the script is loaded synchronously and it will then clear the window content (generates blank page).
    To prevent this issue please make sure that the script is loaded asynchronously since the Cookiebot triggers all scripts asynchronously (i.e. to wait for the visitor’s consent) in order to work properly.
    You need to find out which script is using “document.write” and then rewrite it to use a different approach e.g. “document.write = function(node) {document.body.insertAdjacentHTML(‘beforeend’, node);}”

    Regards,
    Spas

    Thread Starter donmiat

    (@donmiat)

    Hello Spas,

    Checked all the scripts none of them have document.write.

    I even removed all the external scripts just to check if one of them was causing the white screen. But even after removing all scripts it does not work.

    Is there a auto reload after clicking on “allow all cookies” functionality in cookiebot? Cause that would solve the problem. If after clicking on accept the page reloads, the white screen disappears.

    We would really like to keep using CookieBot, so really hope you have a sollution.

    Hi donmiat,

    This is a strange bug that must be investigated, but I cannot really decide what the problem is without seeing the website, but I have never seen a site going blank like this and it was *not* caused by “document.write”.
    If you would like, could you send me the domain of your website, so I can check it out and help you solve the problem afterwards, instead of guessing.

    However, I still consider this to be the most likely because of the “document.write”, maybe you cannot find it because it is references differently, e.g. as asked here, where “document.write” is not directly executed but indirectly as e.g. “d.write”: https://stackoverflow.com/questions/50872515/cookiebot-cookie-consent-script
    so, could you check again please
    Regarding reloading the page on consent, you could place this script next to the Cookiebot script tag:

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

    Regards,
    Spas

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘White page / blank page after clicking “allow all cookies”’ is closed to new replies.