Free · No signup · 100% client-side
Cookie Consent Banner Generator
Build a clean, working cookie banner for your website in under a minute.
Pick your style, get a single copy-paste snippet that remembers the visitor's choice
and exposes a simple window.cookieConsent flag so you can gate your
analytics and marketing tags. No backend, no account, nothing leaves your browser.
2 · Live preview
The preview above is the real generated banner. Click its buttons to test it.
3 · Copy your snippet
Paste this once, just before </body> on every page of your site.
It is fully self-contained — no libraries, no build step.
Disclaimer: This is a customizable banner template to help you get started — not legal advice. Cookie/consent rules (GDPR, ePrivacy, CCPA/CPRA, and others) depend on where your visitors are, what data you collect, and how your site works. Consult a qualified professional for compliance needs.
How to use the snippet
-
Paste it before
</body>Copy the generated snippet and paste it once near the end of your page, before the closing
</body>tag. On Webflow, Squarespace, WordPress, Shopify or a plain HTML site, use the “custom code / footer” area. -
Gate your tracking scripts
The snippet sets a global
window.cookieConsent = { analytics: boolean, marketing: boolean }and fires acookieconsent:changeevent. Wrap your Google Analytics / Meta Pixel / ad tags so they only load when the matching flag istrue— the generated code shows you exactly where. -
It remembers the choice
The visitor's decision is saved in
localStorage, so the banner won't nag them on every page load. They can re-open preferences anytime by callingwindow.cookieConsent.open()(wire it to a “Cookie settings” footer link).