Docs

Installing the script

AdminUpdated Sep 15, 2026

Installing the script

Every property is protected by a single <script> tag. This page covers the tag itself, where to place it, and the attributes that control blocking mode and language.

Get your snippet

From Properties, find your site's card and click Install. The dialog shows a tag generated specifically for that property's cbid (site ID). Click Copy snippet to copy it to your clipboard.

A generated tag looks like this:

<script id="CookieMunch"
  src="https://cdn.cookiemunch.net/consent.js"
  data-cbid="acme-com-9f3k"
  data-blockingmode="auto"></script>

Note: If your dashboard's embed CDN and API run on different origins, the tag also includes a data-api="https://api.yourdomain.com" attribute — copy the snippet as generated rather than retyping it by hand.

Where to put it

Paste the tag as high as possible in <head>, before any analytics, ads, or embed scripts. Placement matters for two reasons:

  • Consent banner timing. The script needs to run early to show the banner before visitors interact with the page.

  • Auto-blocking. In auto mode, the script intercepts DOM insertions from the moment it runs — any tracking script that loads before it is invisible to the blocker. See prior blocking for how blocking works.

Tag attributes

Attribute

Purpose

id="CookieMunch"

Fixed ID the runtime and other page scripts use to find the tag. Keep it as generated.

src

The embed script URL, served from your CDN/embed origin.

data-cbid

Your property's unique site ID. Identifies which config/banner to load.

data-blockingmode

auto (default) or manual — see prior blocking.

data-api

Only present when the API origin differs from the embed origin. Leave as generated.

data-culture

Optional. Forces a starting language (e.g. de, fr) instead of auto-detecting from the browser.

Platform notes

The Platform you chose when adding the property (Web, iOS, Android, AMP, or Other) doesn't change the tag — it only tailors the install guidance shown in the dashboard. For standard web platforms (custom HTML, most site builders and CMSs), paste the tag directly into the site's global <head> include. For tag-manager-driven sites, add it as a custom HTML tag that fires on all pages, set to fire as early as possible (ideally outside of the tag manager's own async loader).

Confirming installation

Reload your site in an incognito/private window. You should see the banner. If you don't see it:

  1. Open your browser's dev tools and confirm the <script> tag is present in the rendered HTML <head> — not injected later by JavaScript.

  2. Check the console for network errors loading consent.js — a stale data-cbid or wrong src origin is the most common cause.

  3. Confirm the property is verified — verification unlocks full dashboard control. See properties.

Next steps

Was this page helpful?
Installing the script