Privacy and Security

Cookie Banners Explained: What the Law Requires and How to Add One Properly

What GDPR and ePrivacy require for cookies, why Reject all must be easy, how to block scripts before consent and set up Google Consent Mode v2.

Saizul Amin
Saizul Amin2 Nov 2026 · 3 min read
Cookie Banners Explained: What the Law Requires and How to Add One Properly

Many websites show a cookie banner that does not actually block anything. The Cookie Consent Banner Generator creates one that does.

What the rules say

In the EU and UK, storing or reading non-essential cookies on a device requires prior consent under the ePrivacy rules, and the GDPR defines valid consent: freely given, specific, informed, unambiguous and as easy to withdraw as to give. The European Data Protection Board's guidelines on consent explain that pre-ticked boxes and continued browsing do not count. In California and several other US states, people can opt out of the sale or sharing of their data, and the Global Privacy Control browser signal is a recognised way to do it.

The features that matter

RequirementHow the banner handles it
Prior consentTracking scripts stay inactive until accepted
Equal choiceAccept all and Reject all side by side
Granular choiceSwitches for analytics and marketing
Withdraw easilyA "Cookie settings" link reopens the choices
ProofChoice, time and policy version stored

Blocking scripts properly

Change tracking scripts from type="text/javascript" to type="text/plain" and add data-category="analytics" or marketing. The banner turns them back into real scripts only for accepted categories. Do the same for embedded videos and maps with data-src.

If you use Google Analytics or Google Ads, Consent Mode tells Google tags what the visitor allowed. Version 2 uses four signals: analytics_storage, ad_storage, ad_user_data and ad_personalization. The banner sets them to denied by default and updates them on choice.

Test it

Open your site in a private window, reject everything, and check your browser's network panel: no requests should go to analytics or advertising domains.

What a banner does not replace

You still need an accurate privacy and cookie policy listing the cookies you use, and larger advertising setups may need a certified consent platform.

Work in small, saved steps

Every tool in this series keeps your work as a project in your own browser. Make a change, check the preview, and use undo (Ctrl+Z) or redo (Ctrl+Y) freely; nothing is lost while you experiment. Before a big change, save a named copy from the Projects menu, so you can return to it later or compare two versions side by side. Export the project file when you want to move it to another computer or keep a backup, and import it again whenever you need it.

Re-asking after changes

When you add a new tool that sets cookies, update your policy and raise the version number in the banner, so visitors are asked again for the new purpose.

Privacy by design

The processing happens in the page itself. Files you open are read by code running on your device, results are calculated locally, and nothing is sent to a server or stored in a cloud account. That makes the tool suitable for customer lists, financial data and other material you would not upload to an unknown website. If a component such as a file reader or a map outline is downloaded from a public CDN, only that open-source code or public data is fetched, never your own content.

Share the result clearly

When you pass the output to colleagues, say where the data came from, when it was exported, and which settings you used, so that someone else can repeat the work and get the same answer. Keep the original file unchanged and store the cleaned or calculated version separately. A short note with the assumptions, filters and date saves a lot of questions later and makes the result easier to trust.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages