Docs

Prior blocking

AdminUpdated Sep 15, 2026

Prior blocking

"Prior blocking" means holding tracking scripts (analytics, ads, embeds) inert until a visitor consents — a GDPR/ePrivacy requirement in most jurisdictions, since cookies can't legally be set before consent for non-essential categories. Cookie Munch supports two modes, configured per-property from Banner Studio → Settings → Behaviour.

Auto mode (default)

data-blockingmode="auto" on your install script tag — the default — makes Cookie Munch intercept scripts and other tracking resources as they're inserted into the page, without you having to touch your existing markup. As soon as the script runs (which is why early placement in <head> matters), it watches for elements being added to the DOM, neutralizes anything that matches a known-tracker checklist so it can't load, and tags it for re-activation. Once the visitor consents to the matching category, tagged elements are re-enabled and load normally.

Auto mode is the fastest way to get compliant blocking on an existing site with no code changes. It's matched against a maintained list of known trackers, so brand-new or highly custom tracking snippets may occasionally be missed — always spot-check with your browser's network tab after installing.

Ignore selectors

Some elements should never be touched by the auto-blocker (a live chat widget, a first-party script you've already vetted). In the Behaviour tab, add CSS selectors to Ignore selectors (comma-separated, e.g. #chat, .no-block) to exclude them from interception entirely.

Note: If you find yourself excluding more than a handful of elements, switch that site to manual mode instead — heavy use of ignore selectors can change script execution order in ways auto mode isn't designed to handle.

Manual mode

data-blockingmode="manual" turns off automatic interception and instead relies on markup you add yourself, giving you exact, explicit control over what's blocked. See the full data attributes reference for syntax; in short:

Scripts — set type="text/plain" (so the browser won't execute it) and add data-cookieconsent naming the category:

<script type="text/plain" data-cookieconsent="statistics,marketing"
        src="https://example.com/tracker.js"></script>

Valid category values are preferences, statistics, marketing, or ignore (combinable with commas, except ignore). On consent, Cookie Munch flips matching scripts to type="text/javascript" and re-injects them so the browser executes them.

Non-script resources (iframes, images) — since they can't use type, rename src to data-cookieblock-src:

<iframe data-cookieblock-src="https://www.youtube.com/embed/xxxx"
        data-cookieconsent="marketing" frameborder="0" allowfullscreen></iframe>

Choosing a mode

Auto

Manual

Setup effort

None — works on existing markup

Requires editing every tracking snippet

Precision

Checklist-based, may miss unusual scripts

Exact — you decide what's blocked

Best for

Fast rollout, general sites

Sites with custom/unusual tracking, or teams wanting full control

Both modes can coexist across your organization — set the mode per property in that property's install script tag and Banner Studio settings; there's no requirement that every property use the same mode.

Re-ask and expiry

Also on the Behaviour tab, the re-ask slider controls how long a visitor's consent choice is remembered (0–730 days) before Cookie Munch shows the banner again — set to "never" to keep a choice indefinitely. Suppress for bots (on by default) skips showing the banner to detected crawlers so they aren't blocked from indexing your site.

Next steps

Was this page helpful?