Cookie Consent Banner Generator

Generate a cookie banner with Google Consent Mode v2 defaults that you can paste into any website.

A lightweight banner that speaks Consent Mode v2

This generator produces a self-contained snippet: a consent banner with Accept all, Reject non-essential and Choose settings buttons, and the Google Consent Mode v2 signals behind them. Before any Google tag loads, it sets the defaults for ad_storage, ad_user_data, ad_personalization, analytics_storage, functionality_storage, personalization_storage and security_storage. When a visitor chooses, it sends a consent update, and the choice is remembered in the browser so the banner does not return on every page.

Setting it up

  • Paste the snippet in the head of every page, above your Google tag or Tag Manager container.
  • Choose whether defaults are denied for the EEA, UK and Switzerland only, or for everyone. Denying only in those regions follows the common approach for sites that serve a global audience.
  • Add a Cookie settings link in your footer that calls sstCookieSettings() so people can change their choice at any time.
  • Test with your browser's developer tools and Google's Tag Assistant to confirm the consent signals change after a choice.

What this does not do

Consent Mode tells Google tags how to behave, but it does not block other scripts. Pixels and widgets from other vendors keep loading unless you load them only after consent, so wire those to the saved choice. A banner also does not make a site compliant by itself: your privacy policy, the cookies you actually set and your legal basis all matter. This tool is a starting point, not legal advice, so have the wording reviewed for your situation.

Why a hand-rolled banner

Many consent plugins are heavy, load their own tracking or sit behind a subscription. A small script with no external requests keeps your page fast and leaves you in control of the text and styling. If you need cookie scanning, proof-of-consent logs or a certified Consent Management Platform, use a dedicated service instead.

Perguntas frequentes

Does this work with Google AdSense and Analytics?

Yes. Both read the Consent Mode signals that the snippet sets. For AdSense in the EEA, UK and Switzerland, Google also requires a certified consent management platform for personalised ads, so check the current AdSense requirements.

Where is the visitor's choice stored?

In the browser's localStorage on your own domain under the key sst_consent_v1. Nothing is sent to us.

Will it block my Facebook Pixel or other tags?

No. It controls Google tags through Consent Mode only. Load other scripts after the saved choice allows them.

Is this legally enough for GDPR or CCPA?

It is a technical starting point. Compliance also depends on your privacy policy, the data you collect and local rules, so get advice if you are unsure.

Can I change the colours and text later?

Yes. Change the options and generate the code again, then replace the old snippet.

Mais em Technical SEO & Site Management