Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jakebellacera
Created June 22, 2018 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakebellacera/a3b179298f058d017449b364fc152ccb to your computer and use it in GitHub Desktop.
Save jakebellacera/a3b179298f058d017449b364fc152ccb to your computer and use it in GitHub Desktop.
<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