Privacy
Do you need a cookie banner for analytics?
When analytics needs consent: what the device storage rule covers, where GDPR comes in, and a checklist. General information, not legal advice.
The CrispStats team · · Updated · 7 min read
In short
It depends on what your analytics does on the visitor’s device and where your visitors are. In the EU and UK, storing or reading information on a device (cookies, localStorage and similar) generally needs consent unless it is strictly necessary, and analytics is rarely treated as necessary. Tools that store nothing on the device are widely argued to fall outside that rule, but regulators differ and data protection law still applies. This is general information, not legal advice.
The honest answer to the title is “it depends”, but it depends on a small number of things you can check. Most of the confusion comes from treating two different rules as one, and from the word “cookie” itself.
Which rules are we talking about?
In the EU and the UK there are two layers, and they ask different questions.
The device rule
The ePrivacy Directive in the EU, implemented in each member state’s own law, and PECR in the UK say roughly this: storing information on a person’s device, or reading information already stored there, needs their consent first, unless it is strictly necessary to provide a service they asked for.
Notice what the rule is about. It is not about cookies as such. It covers cookies, localStorage, sessionStorage, IndexedDB and any other way of keeping or reading something on the device. Swapping a cookie for a localStorage entry changes nothing. This is the rule that cookie consent banners exist to satisfy.
The data protection rule
GDPR, and the UK’s version of it, is separate. It applies whenever personal data is processed, with or without anything stored on a device. Personal data is read broadly: an IP address or an online identifier can qualify. GDPR does not always require consent, but it does require a lawful basis, a clear privacy notice, limits on what you keep and for how long, and a contract with any vendor that processes the data for you.
A tool can avoid the first rule and still be covered by the second. Keep them apart in your head and most vendor claims become easier to evaluate.
Does cookie-based analytics need consent?
In the EU and UK, generally yes. A script that writes an identifier to a cookie is storing information on the device, and regulators have not usually accepted analytics as “strictly necessary” in the way a shopping basket or a login session is. That is why sites using cookie-based analytics show a banner and should only load the script after the visitor agrees.
Some national regulators have described narrow exemptions for simple, first-party audience measurement under strict conditions: France’s CNIL and Spain’s AEPD among them, and the UK added a statistical purposes exception in 2025. Germany’s authorities decline to give a general exemption, and Ireland’s says analytics cookies need consent. Our country-by-country summary links each source; if you are relying on an exemption, read the guidance itself, not a summary of it.
Does cookieless analytics need consent?
Cookieless tracking is designed to stay outside the device rule: the script stores nothing and reads nothing from storage. It sends the page address and referrer, and the server counts visitors with a short-lived hash (the mechanics are in cookieless analytics explained).
The common reading is that this does not trigger the device rule, since nothing is stored or accessed on the device. Many site owners run such tools without a consent banner on that basis.
Three cautions before you do the same:
- Regulators differ. National authorities interpret the device rule with different breadth, and some guidance reads “gaining access to information” widely enough to reach techniques beyond cookies. A position that is comfortable in one country may be questioned in another.
- GDPR still applies. Even with no storage, the server sees an IP address for a moment. You still need a lawful basis (many sites rely on legitimate interests for privacy-preserving statistics), a line in your privacy policy, and a data processing agreement with the vendor.
- “Cookieless” is a label, not a guarantee. Check what the tool actually does. Device fingerprinting stores nothing either, and regulators generally treat it like a cookie or worse.
What else on your site might need a banner?
This is the part people miss. Removing cookies from analytics only removes the banner if analytics was the only reason for it. Open your browser’s developer tools, load your site in a private window, and look at what gets stored before you click anything. Common sources:
- Advertising and retargeting pixels.
- Embedded video players and social media embeds.
- Live chat and support widgets.
- A/B testing, heatmap and session replay scripts.
- Embedded maps, booking forms and comment systems.
- Tag managers, which may load any of the above.
If any of these store non-essential data on the device, you need consent for them whatever your analytics does. The usual options are to remove them, replace them with versions that store nothing, or load them only after a click.
A rough guide by situation
| Your setup | Device rule (EU and UK) | What to do |
|---|---|---|
| Analytics that sets cookies or uses localStorage ids | Generally needs consent | Show a banner and load the script only after agreement |
| Analytics that stores nothing on the device | Widely argued to fall outside it; regulators differ | Check your country’s guidance, document your reasoning, cover it in your privacy policy |
| Cookieless analytics plus ad pixels, chat or embeds | Consent needed for the other tools | Keep a banner for those, or remove them |
| Fingerprinting-based tracking | Generally treated like cookies | Assume consent is needed |
| Strictly necessary storage only (login, basket, language) | Exempt | No consent needed for those, but describe them in your policy |
Outside Europe the picture varies again. Many US state privacy laws, for example, centre on notice and the right to opt out of selling or sharing data rather than on prior consent for analytics. If you have visitors in several regions, the strictest one that applies to you usually sets your baseline.
Questions to ask before you decide
- Does the analytics script write to or read from cookies, localStorage or any other storage on the device? Test it; do not rely on the marketing page.
- Does it build an identifier from device characteristics? If so, treat it as fingerprinting.
- What does the vendor store on its servers: IP addresses, user agents, persistent ids? For how long?
- Can one visitor be followed across days, or across different websites?
- Is the vendor your processor under a data processing agreement, and where is the data processed?
- What other scripts on the site store data on the device?
- Which countries are your visitors in, and what does the regulator there say about audience measurement?
- Does your privacy policy describe the analytics you actually run?
- If you turn on an optional feature later (persistent ids, user identification), does the answer change?
Write the answers down. A short record of what you checked and why you decided as you did is useful if anyone asks, and it makes the next review quick.
How CrispStats is built
Here are our answers to the questions above, so you can check them rather than take a label on trust. Question 1: no cookies, and nothing read from or written to device storage by default. Question 2: no device fingerprint; the identifier is a hash of a daily secret, the site, the IP address and the user agent. Question 3: neither the IP address nor the raw user agent is stored, only the hash. Question 4: the secret rotates daily and the site is in the hash, so no one is followed across days or websites. Question 5: yes, a data processing agreement is published, and the privacy policy below names the storage region.
Question 9 is where the answer can change: the optional persistent visitors mode. It stores a random id in localStorage so returning visitors are recognised across days. That is storage on the device, so it should only be enabled with the visitor’s consent. It is off unless you turn it on.
The cookie policy lists what is and is not stored, and the privacy policy covers the rest. Whether your site can run without a banner depends on everything else in this article, so check it for your own situation. Analytics without a cookie banner sets out what that takes on the analytics side.