Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js?cbid=XXXXXXX" type="text/javascript"></script>
<script>
var cookiebotCurrentlyConsenting = false;
function CookiebotCallback_OnLoad() {
if (!Cookiebot.consented && Cookiebot.isOutsideEU) {
Cookiebot.dialog.submitConsent();
// Set the variable to true so we can show the user the notice just this once
cookiebotCurrentlyConsenting = true;
}
}
function CookiebotCallback_OnAccept() {
dataLayer.push({'event':'cookie_consent'});
if (cookiebotCurrentlyConsenting) {
Cookiebot.dialog.show(); // re-show the dialog so the user can still view the notice even though they are being opted-in by default
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment