What is Cookie Consent Generator?

Builds a GDPR-compliant cookie consent banner and hands you the HTML, CSS, and JavaScript to drop into your site. Pick a style, set the cookie categories, and adjust how consent is stored.

The output is a self-contained snippet: HTML for the banner, CSS for the styling, and a small JavaScript shim that writes the visitor's choice to a cookie and reloads only the categories they accepted. You can paste it directly into your site or download the three files as a zip for cleaner integration.

How to use

  1. Pick a banner style (top bar, bottom bar, modal, corner popup) and customize colors, text, and button labels.
  2. Configure cookie categories (necessary, analytics, marketing, functional), how long consent is remembered, and the consent behavior (opt-in vs opt-out).
  3. Copy or download the generated HTML/CSS/JS code and add it to your website.

When to use

  • Adding a GDPR or CCPA notice to a static site or marketing landing page.
  • Replacing a heavy third-party CMP that loads 200 KB before the user clicks anything.
  • Prototyping a banner design before handing the spec to your engineering team.

Result

A site owner creating a GDPR-compliant blog selects a bottom bar banner with 'Accept All' and 'Manage Preferences' buttons, enables analytics and marketing categories, and downloads the code snippet to add before the closing body tag.

FAQ

Does this generator make my site GDPR compliant on its own?
The banner gives the visitor a clear opt-in or opt-out choice and stores their preference, which covers the consent UI requirement. You still need a privacy policy page and you must actually block scripts in the categories they reject.
How do I block Google Analytics until consent is given?
Two ways. The simplest is to tick the Google Consent Mode v2 box: the generated script then emits gtag consent signals, starting denied and switching to granted only after the visitor accepts the matching category. Otherwise, gate the gtag tag yourself behind an if-check that reads the cookie the banner sets, so the script is never inserted until consent is given.
Can I change the wording after I have already deployed the banner?
Yes. Re-open the generator with similar settings, regenerate, and replace the strings inside the banner div. Existing visitors keep their previous consent because the cookie name does not change.
What is the difference between opt-in and opt-out mode?
Opt-in starts with all non-essential categories disabled and only activates them after the user accepts. Opt-out starts with them enabled, which is allowed under CCPA but not under GDPR. Pick opt-in if any of your visitors are in the EU.
Will the banner show up again every time someone visits?
No. Once a visitor saves a choice, the cookie lasts as long as the expiry you set (six months by default). The banner only reappears after that, or if the cookie is cleared, or if you bump the consent version inside the JS file.

Related Tools