MetricRaven

Guide

Do you need a cookie banner for analytics?

Updated · 7 min read · Sources checked Nov 24, 2026

Short answer

Whether you need a cookie banner for analytics depends on what the tool stores or reads on the visitor's device, not on the word “analytics”. In the EU, storing or reading anything on a device needs consent unless it's strictly necessary, and analytics usually isn't. A tool that stores nothing removes that trigger. France and, since February 2026, the UK allow some analytics without consent under conditions. GDPR still applies either way. This is a practical guide, not legal advice.

Most of the confusion comes from treating two laws as one. The cookie banner comes from the ePrivacy rules about devices; your privacy notice and lawful basis come from GDPR. Analytics can need a banner and a lawful basis, only a lawful basis, or, outside Europe, often neither. Here's how to tell which, what changes when a tool is cookieless, and exactly what MetricRaven's tracker does.

Two laws, two different questions

ePrivacy and GDPR, side by side
ePrivacy Directive, Article 5(3)GDPR
What it coversStoring information on, or reading it from, a visitor's deviceAny processing of personal data
Triggered byCookies, localStorage, pixels and other device accessPersonal data such as IP addresses and online identifiers
What it requiresConsent, unless the access is strictly necessary for a service the user asked forA lawful basis (consent, legitimate interests and others), transparency and data rights
Where you see itThe cookie bannerThe privacy notice

Article 5(3) of the ePrivacy Directive says storing or reading information on a user's device is only allowed with consent, except for transmitting a communication or what's “strictly necessary” to provide a service the user explicitly requested (EUR-Lex). Analytics helps you, not the visitor, so in most EU countries it doesn't count as strictly necessary. Each country writes this into its own law; Germany's version is §25 of the TDDDG (gesetze-im-internet.de).

GDPR is separate. It applies whenever you process personal data, cookies or not, and needs one of the lawful bases in Article 6 (GDPR). IP addresses can be personal data: Recital 30 names them as online identifiers, and the EU Court of Justice held in the Breyer case that even a dynamic IP address can be personal data for a website operator (C-582/14). So “no banner” never means “no GDPR”.

Does cookieless analytics mean no banner?

Not automatically. Article 5(3) is about device access in general, not cookies. The EDPB's guidelines on its technical scope, adopted in October 2024, say it applies to localStorage once the data or anything derived from it is read, to tracking pixels and tracking links, and can apply to IP-based tracking too (EDPB Guidelines 2/2023). They also say that falling under Article 5(3) “does not systematically mean that consent needs to be collected”: an exemption may still apply.

What cookieless tracking does change is the common case. A script that writes nothing to the device and keeps no identifier there gives the ePrivacy rule much less to bite on. How a tool does that, and what it gives up, is in what is cookieless tracking. Ask any vendor three questions: what does the script store, what does it read, and what does the server do with the IP address?

The banner covers your whole site, not one tool. If you also run GA4, a Meta pixel, an embedded video player or a chat widget that sets cookies, you need consent for those whatever your analytics does.

Where analytics can run without consent

Analytics consent rules by jurisdiction (summary, checked November 2026)
WhereRule for analyticsConditions
FranceAudience measurement can be exempt from consent (CNIL)Strictly limited to measuring the site's own audience, for the publisher only, producing anonymous statistics, with no cross-referencing, no transfer of non-anonymous data and no tracking across sites. CNIL also recommends trackers last no more than 13 months and data be kept no more than 25.
United KingdomStatistical analytics exemption in force since 5 February 2026 (Data (Use and Access) Act 2025, Schedule 12)The sole purpose is statistics to improve your site or service, data is shared only with those helping you improve it, visitors get clear information, and they have a simple, free way to object.
GermanyNo analytics-specific exemption in §25 TDDDGConsent unless strictly necessary for the service the user requested.
Rest of the EUConsent unless strictly necessary; national regulators differ in detailCheck your national authority's guidance.
United StatesNo federal law like Article 5(3)California's CCPA is opt-out: people can stop the sale or sharing of their data, including through Global Privacy Control (California AG).
A summary for orientation, not legal advice. Laws and regulator guidance change; check the sources and your own counsel.

Both the French and UK exemptions have the same shape: analytics for your own site, no cross-site tracking, no advertising, and transparency. The moment an analytics tool also feeds ad platforms, the exemption is gone.

What this means for Google Analytics

GA4 sets cookies, so in the EU and UK it sits behind your banner. Google also requires sites that use its measurement and advertising features for users in the EEA to collect consent and pass it to Google through consent mode (Google Ads Help). With consent mode's basic setup, nothing reaches Google when a visitor declines. With the advanced setup, Google receives cookieless pings and models the gaps (consent mode), which is one reason GA4 totals don't match tools that only count what they measured.

If you're moving away from GA4 for this reason, how to switch from Google Analytics walks through running both and keeping your history, and the Google Analytics alternatives roundup compares the replacements.

A practical checklist

  1. List every script on your site and what each stores: analytics, ad pixels, chat, video embeds, A/B testing. Your browser's Application panel shows cookies and storage after a fresh visit.
  2. If anything needs consent, you need a banner anyway. Then the question is only how your analytics behaves before and after the visitor chooses.
  3. Configure analytics to store nothing before consent, and to keep an identifier only once the visitor allows statistics.
  4. Decide your lawful basis under GDPR for the processing that happens either way (often legitimate interests for basic, first-party statistics) and describe it in your privacy notice, with your analytics vendor as a processor.
  5. Keep analytics away from advertising if you rely on an exemption: sending visitors' data to ad networks needs consent.
  6. Ask your counsel to confirm for your countries. This post is general information, not legal advice.

Exactly what MetricRaven's tracker stores

MetricRaven's script stores nothing in the browser until your site grants consent. No cookie, no localStorage and no sessionStorage are written. The only thing it reads before consent is an opt-out flag (ana_ignore) you can set in your own browser to exclude your visits.

  • Before consent: the server derives a visitor ID as a keyed hash of the date, your site, the IP address and the user agent, so it changes every day and the same browser isn't followed from one day to the next. The IP address is used when the event arrives to derive approximate location and that daily ID, and isn't stored with analytics data. That use of the IP is processing of personal data under GDPR, so it belongs in your privacy notice even without a banner.
  • With consent: a random ID is kept in a first-party cookie (ana_vid) and localStorage for a year, so visits on different days join up. The list of linked domains and the site's tracking switches (no identifier) are kept in sessionStorage for the tab, for up to an hour.
  • Withdrawn consent removes the stored ID. Session replay records only visitors who accepted by default, and ad click IDs are only sent with separate advertising consent (Consent & visitor IDs).
  • On WordPress, the plugin can follow the WP Consent API, so banners such as Complianz and CookieYes switch the stored ID on when the visitor allows statistics (WordPress).
Connect your cookie banner
consent.js
// Before the MetricRaven script, if the visitor already allowed analytics storage:
window.analyticsConsent = true;

// From your banner's accept and withdraw handlers:
window.analytics?.setConsent(true);
window.analytics?.setConsent(false);

Before consent, a payment still reaches the visit it came from when your checkout carries the visitor ID; joining visits on different days needs the stored ID or a sign-in. The chart below shows why consent matters for one report: returning visitors across days need the stored ID.

Orbit Analytics · synthetic data · last 30 days

Live demo data
New and returning visitors on the demo site. Recognizing a visitor on a later day needs the ID that is stored only after consent.Open the demo

FAQ

Do I need a cookie banner if my analytics doesn't use cookies?

Not for the analytics alone, if it stores and reads nothing on the device, though EU regulators say device-access rules can also cover pixels, localStorage and some IP-based tracking. Your other scripts may still need consent, and GDPR applies regardless.

Is Google Analytics allowed without consent in the EU?

GA4 sets cookies, so it needs consent in most EU countries, and Google requires consent signals from EEA users for its measurement and advertising features.

Can I use analytics without consent in the UK?

Since 5 February 2026, the UK allows storage or access used only to collect statistics for improving your own site or service, if visitors get clear information and a simple, free way to object.

Is an IP address personal data?

It can be. GDPR names IP addresses as online identifiers, and the EU Court of Justice held that a dynamic IP address can be personal data for a website operator. Tools that process IPs, even briefly, are processing personal data.

Does MetricRaven need a cookie banner?

MetricRaven stores nothing in the browser before consent and keeps an ID only after your banner grants it. Whether your site needs a banner depends on your other scripts and the law where your visitors live.

Sources

Figures from these pages were checked on Nov 24, 2026. Charts marked “Live demo data” come from MetricRaven's public demo, which runs on synthetic data, not a real customer's.

Further reading

All posts

See which channels bring paying customers

Traffic, goals, funnels and revenue in one dashboard. Start free, or explore the live demo first.

14-day free trial, no card required.