Implement Cookiebot Consent Management Platform (CMP) on your website to ensure you obtain consent from your website users before you make use of cookies and online trackers.

To correctly implement Cookiebot CMP 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 CMP account and add your domain

Sign up to create a Cookiebot CMP 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.


<script id="Cookiebot" src="" data-cbid="00000000-0000-0000-0000-000000000000" type="text/javascript" async></script>

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.


  <h1>Cookie Declaration</h1>
  <script id="CookieDeclaration" src="" type="text/javascript" async></script>

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"> 
    i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();
    ga('create', 'UA-00000000-0', 'auto'); 
    ga('send', 'pageview'); 

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

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

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

Additional resources

  • You can make use of our automatic cookie blocking feature instead of manually marking up cookie-setting scripts. Follow our guide.
  • You can also use our JavaScript SDK to customize Cookiebot CMP, for example to create alternative ways for the user to withdraw or change a consent.
  • Frequently asked questions about how Analytics data is impacted by the requirement to obtain user consent and our help center (in English)

    Stay informed

    Join our growing community of data privacy enthusiasts now. Subscribe to the Cookiebot™ newsletter and get all the latest updates right in your inbox.

    By clicking on “Subscribe” I confirm that I want to subscribe to the Cookiebot™ newsletter. I can easily cancel my Cookiebot™ newsletter subscription and revoke consent to use my data by clicking the unsubscribe link or I can write to [email protected] to make the request. Privacy policy.