Logo Logo
Cookiebot

To correctly implement Cookiebot on your website, and manually mark up cookie-setting scripts, follow the 4 steps below. Please note that you can make use of our automatic cookie blocking feature instead. Follow our 3-step guide.

Step 1 - Create a Cookiebot account and add your domain

Sign up to create a Cookiebot account. Log in to your account and add your website domain name(s). Save. The website will now be scanned (please allow up to 24 hours for the scan to complete).

Step 2 - Choose the cookie consent banner you want to display on your website

Go to “Settings” and “Dialog” and choose your cookie consent banner. The default banner is configured with the strictest settings possible (suitable for cookie consent under GDPR and ePR).

Under “Settings” and “Content”, edit the default banner text so it fits your website and legal requirements.

Step 3 - Insert 2 scripts on your website to make the cookie consent banner and Cookie Declaration appear

Go to "Settings" and "Your scripts".

1. Cookie consent banner: Copy the top script and insert it to the header of your website template.

Example:

<html>
<head>
<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="00000000-0000-0000-0000-000000000000" type="text/javascript" async></script>
</head>
<body>
  ...
</body>
</html>

2. Cookie Declaration: Copy the second script and insert it in the HTML on the specific page and at the exact position where you would like the Cookie Declaration to appear.

This could be as a separate page on your website or embedded into an existing privacy policy. The standard Cookie Declaration lists all cookies and trackers discovered on your website and allows the user to withdraw (or change) a consent at any time – as required under e.g. GDPR.

Example:

<html>
  ...
<body>
  <h1>Cookie Declaration</h1>
  <script id="CookieDeclaration" src="https://consent.cookiebot.com/00000000-0000-0000-0000-000000000000/cd.js" type="text/javascript" async></script>
</body>
</html>

Step 4 – Mark up cookie-setting script tags on your website to control cookies

When the website scan is complete, check your scan report. If there are any unclassified cookies, log in to your account and under “Cookies” make sure to classify them and add a short purpose description.

Then, all "preferences", "statistics" and "marketing" cookies and trackers must be marked up for prior consent. This is to ensure that until the website user has given a consent, no cookies other than those strictly necessary are set. Only those categories of cookies the user has consented to will be activated upon consent – all other cookies will be held back automatically.

Information about where in the source code a cookie-setting script is located is listed in the scan report (where applicable). 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','//www.google-analytics.com/analytics.js','ga'); 
    ga('create', 'UA-00000000-0', 'auto'); 
    ga('send', 'pageview'); 
</script>

Example on modifying an existing JavaScript file classified in the scan report as a marketing cookie:

<script type="text/plain" data-cookieconsent="marketing" src="//widget.manychat.com/1234567891011.js"></script>

If your website is loading scripts dynamically, use the functions of the JavaScript SDK for full control.

Additional resources

Make your website’s use of cookies and online tracking GDPR/ePR compliant today

Try for free