Privacy and the law

Do you actually need a cookie banner?

The rule is simpler than the advice around it, and it is not the rule most people think it is. Here it is, with a flowchart.

Possibly not — and the test is simpler than most people expect.

Almost everyone assumes the question is do we collect personal data? It is not. There is one rule that decides it, and once you know the rule you can work out your own answer in about five minutes.

The rule, in one sentence

If something on your page stores information on the visitor's device, or reads information already there, you need consent — unless it is strictly necessary for something the visitor actually asked for.

That's Article 5(3) of the ePrivacy Directive, which every EU country implements separately and which the UK has as PECR. Three things about it catch people out.

It doesn't say "cookies". It says information stored on or read from the device. A cookie is one way. localStorage is another. So is IndexedDB, so is a cache probe, so is a device fingerprint. Calling your tool "cookieless" doesn't get you out of it if it still writes something.

It applies even when the data isn't personal. Store a completely random, meaningless string on someone's device and you've triggered the rule. The trigger is the act of writing, not the sensitivity of what was written.

"Strictly necessary" means necessary to the visitor, not to you. A shopping basket that survives a page change is necessary — they asked for the basket. Knowing which blog post performs best is necessary to you. No regulator has ever accepted analytics under this exemption.

The flowchart

A decision flowchart. Start: does anything on the page write to or read from the visitor's device? If no, no banner is needed for that script. If yes, ask whether it is strictly necessary for something the visitor requested. If yes, no consent is needed. If no, consent is required before it runs, and refusing must be as easy as accepting.

Run this once per script on your page, not once for the whole site. One script failing the test is enough to need the banner.

Run it over your own page

This is the part people skip, and it's why so many sites swap their analytics, remove the banner, and are still non-compliant. You have to check every script, not just the one you were thinking about.

A table of common scripts on a website and whether each one typically requires consent. Google Analytics, advertising pixels, embedded YouTube videos in standard mode, chat widgets, A/B testing tools and tag managers with marketing tags all typically require consent. Session cookies, the consent record itself, load balancer cookies and cookieless analytics that write nothing typically do not.

The usual offenders. The embedded video is the one that catches people most often — a single YouTube embed in standard mode writes to the device before anyone presses play.

Go through your own pages with the network tab open and the application tab next to it. Load the page in a private window, don't touch anything, and look at what has already been written. Most people are surprised by at least one thing.

What a banner costs you

Nobody puts numbers on this, so here are the three places it costs you.

You lose people at the door. An interruption before the content loses some people outright. They came from a search result, met a dialogue box, and went back.

You stop being able to count them. Everyone who refuses, or who closes the banner without choosing, is invisible to your analytics afterwards. Your numbers are now a sample of the agreeable, and the gap between what happened and what you can see is wider than the number in front of you suggests.

It says something about you. A banner is a public statement that your site does something to people that needs permission. Most visitors don't read it, but the ones who do are often the ones evaluating whether to buy from you.

The second cost compounds the first: you lose visitors, and you lose the ability to see that you lost them.

What it takes to drop it

You need every script on the page to pass the flowchart. In practice that means:

  • Analytics that writes nothing to the device. That's us — nothing stored, no IP address kept, and counting still works.
  • Embedded videos switched to their no-cookie mode, or a click-to-load placeholder.
  • Fonts served from your own domain rather than a third party.
  • Maps, chat and A/B tools either removed or behind a click.
  • Advertising pixels gone. There is no polite version of this one — if you retarget, you need consent, and that is the end of it.

That last one is the honest catch. If your business runs on retargeting you are keeping a banner whatever analytics you pick. The good news is that it can become a much smaller one — a banner about the ads alone is an easier ask than the all-purpose version most sites show, and more people say yes to it.

The short version

  1. The test is "does it write to the device", and you run it on every script on the page, not just your analytics.
  2. Strictly necessary means necessary to the visitor. Analytics never qualifies.
  3. If you keep the banner, make refusing as easy as accepting. That part is not optional and it is the part most often got wrong.
  4. Removing the banner is an all-or-nothing job. One retargeting pixel puts it back.

If you want the legal reasoning rather than the decision — the articles, the recitals, what regulators have actually ruled, and where the 2022 Google Analytics decisions stand now — that's in what makes web analytics GDPR-compliant.

Common questions

Do I need a cookie banner if I only use Google Analytics?

Yes. GA4 writes _ga to the visitor’s device, and writing to the device is the thing that needs consent. It does not matter that you are only counting visits and not running ads — the rule is about the storage, not about your intentions.

Does a cookie banner have to have a reject button?

Yes, and refusing has to be as easy as accepting. A banner with a big "Accept all" and a buried "Manage preferences" that takes four clicks to refuse has been ruled non-compliant repeatedly across the EU. If you are going to have one, make the reject button a button.

What counts as strictly necessary?

Things the visitor asked for that cannot work without storage: a shopping basket that survives a page change, a login session, a language choice they set, a load balancer keeping them on one server, and the record of a consent refusal itself. Analytics has never qualified anywhere, however much you need it.

Can I just use legitimate interest instead of consent?

Not for the storage question. Legitimate interest is a lawful basis under the GDPR for processing personal data, and it is a real option for some analytics. It is not an alternative to consent under the ePrivacy rules, which require consent for writing to a device full stop. Two different laws, and the storage one has no legitimate-interest route.

What happens if I just do not have one?

If nothing on your site writes to the device, nothing happens, because nothing required it. If things do and you have no banner, you are exposed to a complaint, and in practice complaints are what trigger enforcement in this area rather than proactive audits. The more common outcome is quieter: a prospective customer runs a scan before signing and you lose the deal.

All writing

Read next

Measuring without cookies

Ready

Paste one line. Watch the first visitor arrive.

A 1270-byte script, no cookie banner, and a dashboard that fits on one screen. 30 days on the plan you pick. A card is taken up front and charged when the trial ends, unless you cancel first.