Install, from the README
<!-- 1. in <head>, as early as possible -->
<script src="/cookie-banner.js"></script>
<!-- 2. tag what needs consent -->
<script type="text/plain"
data-cookie-category="analytics"
src="https://example.com/analytics.js"></script>
<!-- 3. let visitors change their mind -->
<a href="#"
onclick="GoodCookieConsent.showBanner();return false">Cookie settings</a>
- Zero external requests
- Config is baked into
cookie-banner.js. Consent is stored in a first-party cookie, goodcookie_consent, for 12 months. Nothing is sent anywhere.
- Blocks the scripts you tag
- Tagged analytics and marketing scripts stay inert until the visitor agrees to that category. After “Accept”, the banner switches them on without a page reload.
- Reject is one click
- “Reject all” sits on the first layer right next to “Accept all”, as a full button rather than a buried link. Categories are granular and nothing non-essential is pre-ticked. Visitors can reopen it any time from a link you add.
- Google Consent Mode v2
- Sets every Google consent signal to
denied by default and updates it after the visitor chooses. Relevant only if you use Google tags.