Enable Cookiebot prior consent manually

Attention: This article has been made before the launch of the Cookiebot “automatic cookie blocking” feature. You can still use manual cookie blocking. To implement Cookiebot on your website, and manually mark up cookie-setting scripts, follow the steps below.

To enable Cookiebot automatic cookie-control, the script needs editing: Remove the async attribute and add a data-blockingmode=”auto” attribute.

Prior consent

Tip: Using Google Tag manager? Read the Google Tag Manager deployment guide.

To enable prior consent, apply the attribute “data-cookieconsent” to cookie-setting script tags on your website. Set the comma-separated value to one or more of the cookie categories “preferences”, “statistics” and “marketing” in accordance with the type of cookies being set by each script. Finally change the attribute “type” from “text/javascript” to “text/plain”.

Example below is how to modify an existing Google Analytics Universal script tag:

<script type="text/plain" data-cookieconsent="statistics">

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-00000000-0', 'auto');

ga('send', 'pageview');