banner.js from the TruePrivacy CDN, reads your published configuration using your site’s public key, and renders the banner according to the visitor’s region and consent state.

The script tag
Place this in your site’s<head>, before any analytics or marketing scripts:
Configuration is fetched from
GET /v1/public/consent/{publicKey}/config and cached at the CDN edge, so banner load adds minimal latency.Blocking scripts until consent
For opt-in compliance, tracking scripts must not execute before consent. TruePrivacy uses the standardtype="text/plain" blocking pattern:
banner.js rewrites the script to type="text/javascript" and executes it — without a page reload. Valid category slugs are shown on the Categories screen (defaults: necessary, preferences, statistics, marketing).
Single-page applications
The banner supports SPAs (React, Vue, Angular, Next.js client routing) out of the box:- The script detects history-API navigation and keeps consent state consistent across route changes.
- Use the JavaScript API to integrate with your app:
Testing your installation
Load your site in a private window
The banner should appear on first visit with no prior consent state.
Reject all, then inspect cookies
Open DevTools → Application → Cookies. Only Necessary cookies should exist.
Run a scan to confirm
A cookie scan verifies from the outside what actually loads on your pages.