Installation
1. Create a site
Sign in to the admin and create a site. You'll get a unique slug.
2. Paste one line above GTM
Put this in the <head> of the client's site, above any GTM orgtag snippet:
<script src="https://your-domain.com/cb/loader.js?slug=CLIENT_SLUG"></script>
3. Block non-essential scripts
Swap type="text/javascript" for type="text/plain" and add a category attribute:
<script type="text/plain" data-consent-category="marketing"
src="https://example.com/pixel.js"></script>Categories: necessary · functional · analytics · marketing.
4. Google Consent Mode v2
The loader fires gtag('consent','default', …) synchronously before GTM boots, andgtag('consent','update', …) on every decision. All 7 signals are sent. No extra GTM configuration is needed on Google tags — their built-in Consent Settings handle gating automatically.
5. dataLayer events
{
event: 'cookie_consent_update',
consent_action: 'accept_all' | 'reject_all' | 'save_preferences' | 'restored',
consent: { necessary, functional, analytics, marketing },
consent_mode: { ad_storage, ad_user_data, ad_personalization,
analytics_storage, functionality_storage,
personalization_storage, security_storage },
timestamp: 1712345678901
}6. JavaScript API
ConsentBanner.show()/show(true)— re-open banner / preferences.ConsentBanner.accept()/reject()— programmatic choice.ConsentBanner.getConsent()— current state.ConsentBanner.getRegulation()— GDPR / CCPA / LGPD / DEFAULT.ConsentBanner.onConsentChange(cb)— subscribe; returns unsubscribe.