Cookie banner
Blocking before consent
How the cookie banner holds back known analytics and marketing tools until the visitor consents, which loading methods it can and cannot intercept, and how to close the gaps.
Consent must come before cookies are set or tracking runs. The banner script does this in two ways: automatic blocking of known trackers, and markers you add yourself.
#Automatic blocking
Automatic blocking is on by default. The banner holds back scripts, frames, images and requests that come from tools in a built-in list of known trackers, and releases them when the visitor accepts their category. A tool you declared yourself follows the category you gave it.
The built-in list covers common analytics, advertising, session recording and social tools. It is reviewed regularly and extended as new tools are found.
#Mark your own scripts
For scripts the list does not know, change the tag type and name the category:
<script type="text/plain" data-pb-category="analytics" src="https://example.com/tool.js"></script>
Categories are functional, analytics and marketing. Embedded content such as videos uses data-pb-src instead of src. A placeholder is shown in place of a blocked frame.
#Removing cookies
When a category is refused or withdrawn, the banner removes the cookies of well-known tools of that category, such as Google Analytics, Meta Pixel, Hotjar and Clarity, from your site. A tool you declared as necessary keeps its cookies.
#What cannot be blocked
Some ways of loading code cannot be intercepted by any script on the page:
- Dynamic imports and WebSocket connections.
- Scripts written with
document.write. - Images set from style sheets.
- A tracker placed before the banner's own line.
- Cookies of other names, cookies set by another domain and cookies marked HttpOnly cannot be removed from the page.
- Server-side tools, for example tools loaded by Cloudflare Zaraz, run outside the page. See Cloudflare Zaraz.
The site check shows what your pages contact before a visitor chooses, so you can spot these cases.
#Tags written in the page
A tag written directly in your HTML is prevented from running before consent, but the browser may still request the file. To avoid the request completely, change the tag as the scan shows.
#FAQ
#Does blocking slow down my site?
Blocked tools do not load until consent, which usually makes the first page load lighter.
#Why does a tracker still load before consent?
It was likely placed before the banner's script line, loaded by a mechanism that cannot be intercepted, or is not in the list and not declared. Use the site check to find it.
Privacyboard is a guidance tool, not legal advice. This page describes what the product does today. Found something unclear or out of date? Write to antoine@unmake.io.