Manually enable prior consent

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

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

Tip: Using Google Tag manager? Read our 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 types of cookies being set by each script. Finally change the attribute “type” from “text/javascript” to “text/plain”. Example on modifying 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','//','ga');

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

ga('send', 'pageview');


14 day free trial Cookiebot

Cookie scanner, cookie banner, cookie declaration and cookie consent in one solution.

  • Use cookies on your website compliant with GDPR, ePrivacy and cookie legislation
  • Cookie management completely automated
  • Cookie banner based on your corporate identity
  • Automatic composed cookie declaration, always up to date

The Cookiebot solution runs on 1.4 million websites, manages 5.2 billion monthly User Consents and supports 47+ languages.