Skip to content

Install the snippet

Each domain has its own snippet. Copy it from the domain’s page in the portal. It looks like this:

<script src="https://consent.cookiedoo.net/js/cb.min.js" data-cbid="YOUR-DOMAIN-KEY" data-language-auto></script>

Put it in the <head> of every page, before any other script, and without async or defer.

The script has to run before Google Tag Manager, Google Analytics, the Meta Pixel and any other tag, because it:

  • sends Google Consent Mode its “denied” defaults before Google tags load,
  • watches cookie writes, so that cookies of categories without consent are removed,
  • releases the scripts you have marked as blocked only after consent (see Block scripts).

If it loads later, trackers may set cookies before the visitor has chosen, and the scan will report them as set before consent.

Attribute What it does
data-cbid Your domain’s key. Required.
data-language-auto Takes the language from the page address when it starts with a language code, such as /el/… or /de/….
data-language="el" A fixed preferred language.
data-cookiedoo-detect="1" Reports unknown cookies on every visit instead of about 2% of visits. Use it only to test an installation (see New cookies between scans).

The banner picks the first language it offers from: the page address (with data-language-auto), data-language, then the visitor’s browser languages. Otherwise it uses the first language of the banner.

If your site sends a Content-Security-Policy header, allow https://consent.cookiedoo.net in script-src and connect-src. The banner’s styles are added by the script, so style-src needs 'unsafe-inline'.

Sites installed before November 2026 load the script from https://api.cookiedoo.net. Those snippets keep working; you don’t need to change them. If your Content Security Policy lists api.cookiedoo.net, keep it there until you switch to the snippet from the portal.