No page refresh
Hi all,
I am using a custom Cookie Banner on around 9 sites, only on staging at the moment, now I have recently noticed that whether you select reject all or accept all cookies the page doesn't refresh and so the browser doesn't recognise that the user has made a change, I've also tried this with an out of the box banner set up and exactly the same thing occurs. Is there a workaround for this that once either of these buttons is clicked it refreshes the browser cache.
Thank
Scott
-
Hi
I'm in the same boat - did you ever figure it out?
Adam
0 -
Hey,
If you think this is necessary, the workaround here will be to add eventListeners to the buttons that execute location.reload() method that reloads the current URL, like the Refresh button.Reguards,
Martin0 -
Ok - thanks - will look into that.
0 -
Thank you I'll look into that too.
0 -
A Linkt to the solution for other Customers where helpfull or is it Top Secret?
0 -
I would also like a real world solution for all browsers.
I have implementet the script below, but for Safari Browsers it shows the consent dialog on each load
<script data-cookieconsent="ignore">
window.addEventListener('CookiebotOnDialogDisplay', function (e) {
var cybotCookiebotDialogBodyLevelButtonAccept = document.getElementById('CybotCookiebotDialogBodyLevelButtonAccept');
if (cybotCookiebotDialogBodyLevelButtonAccept != undefined) {
cybotCookiebotDialogBodyLevelButtonAccept.addEventListener('click', function (e) {
if (Cookiebot.consent.marketing) {
writeTopScroller();
}
});
}
});
</script>0 -
On my Script, we will that if *preferences" not set, that the "CookieConset" set zo date 1970 - that works.
What not is working, is the Reload, if set customer "Marketing" or "Statistic" - Did i make a error in Script?<script type='text/javascript'>window ['gtag_enable_tcf_support'] = true;</script><script id='Cookiebot' data-culture='DE' src='https://consent.cookiebot.com/uc.js' data-cbid='96fd78a1-1836-4e16-b879-9e4578444ea1' data-framework='IAB' data-blockingmode='auto' type='text/javascript'></script> <script type='text/javascript'> window.addEventListener('CookiebotOnDialogInit', function (e) { InitListnerCMP();}, false); if (!Cookiebot.consent.preferences) { document.cookie = 'CookieConsent=;expires=' + new Date(0).toUTCString(); }; function InitListnerCMP(){ window.addEventListener('CookiebotOnAccept', function (e) { if (Cookiebot.consent.statistics || Cookiebot.consent.marketing) { document.location.reload(); }; }, false); } function CookiebotCallback_OnAccept() { Cookiebot.changed && (Cookiebot.consent.statistics || Cookiebot.consent.marketing) && document.location.reload(); } </script> 0 -
The History interface allows manipulation of the browser session history , that is the pages visited in the tab or frame that the current page is loaded in.
There are multiple ways to Refresh/Reload a page with jQuery/JavaScript, some are:
location.href = location.href
location.replace(location.pathname)
window.location = window.location
window.self.window.self.window.window.location = window.location0
Please sign in to leave a comment.
Comments
8 comments