Every site that measures its visitors needs a privacy notice. Some also need a consent banner. The two come from different laws, and mixing them up is how sites end up with a banner that does nothing, or without one when they need it.
This page is research, not legal advice. For what each tool measures and how they compare, see Web Analytics for Product Builders.
The short version
- A notice is always required. The GDPR requires it whenever you process personal data, and analytics usually involves some.
- A banner is required when you store or read something on the visitor’s device and no exemption applies. That rule is Article 5(3) of the ePrivacy Directive, and the UK’s version, PECR.
- “Cookieless” removes the cookie, not the question. The EDPB reads Article 5(3) to cover a script that makes the browser send information, even when it stores nothing. Whether consent is then needed depends on an exemption, and the EU, France and the UK answer that differently.
- Server-side measurement is the only kind outside the rule entirely. Cloudflare’s request analytics is an example.
- GA4 and Clarity set cookies. Gate both behind consent for visitors from the EEA, the UK and Switzerland.
Why “cookieless” is not the end of it
The EDPB’s Guidelines 2/2023, final version adopted in October 2024, set out when Article 5(3) applies. Three passages matter for analytics:
- Scripts (paragraph 33). JavaScript “where the accessing entity instructs the browser of the user to send asynchronous requests with the targeted information” is access that “clearly falls within the scope” of the rule. That describes most analytics beacons, with or without cookies.
- Pixels and tracking links (paragraphs 50–51). They are covered too, including when built by a script.
- IP-based tracking (paragraph 55). Tracking based on the IP address alone can be covered. Unless you can be sure the address does not come from the user’s own device, you “take all the steps” the rule requires.
The guidelines then add (paragraph 56) that being in scope “does not systematically mean that consent needs to be collected”. They leave the exemptions to be assessed case by case. So for a cookieless analytics script, the EU-wide answer is: in scope, consent unless an exemption applies.
National regulators fill that gap differently:
-
France. The CNIL exempts audience measurement from consent when all of its conditions are met:
- the data is used only to produce anonymous statistics for the site itself;
- it is not combined with other data or shared;
- there is no tracking across sites;
- visitors are told and can object;
- IP addresses are truncated;
- trackers last no more than 13 months.
The CNIL warns that vendors who reuse the data for their own purposes fall outside the exemption.
-
The UK. The Data (Use and Access) Act 2025 added exceptions to PECR’s consent rule, including one for statistical purposes: measuring how a service is used in order to improve it. Section 112, which makes that change, came into force on 5 February 2026, under regulation 2 of the commencement regulations. The ICO’s storage and access guidance says you must still tell people clearly and give them a simple way to object.
-
A possible EU change. On 19 November 2025 the European Commission proposed its Digital Omnibus, which would move the cookie rule into the GDPR, with a consent exemption for a provider’s own audience measurement. The text is still being negotiated, per the Parliament’s procedure file, and it is not law. Today’s rules apply until it is adopted.
What that means in practice: a first-party, cookieless, aggregate analytics setup is the low-risk choice. It fits the French and UK exemptions when you give notice and an opt-out. In the rest of the EU it rests on the same reasoning, but no rule says so outright. If most of your audience is in one EU country, check that country’s regulator.
Tool by tool
| Tool | What it puts on or reads from the device | EU position | What to do |
|---|---|---|---|
| Cloudflare HTTP analytics | Nothing; it counts requests at Cloudflare’s edge | Outside Article 5(3) | List it in your notice under hosting |
| Cloudflare security cookies | __cf_bm for bot management, and challenge cookies such as cf_clearance | Cloudflare classes them as strictly necessary | Name them in your notice. They are usually exempt |
| Cloudflare Web Analytics | A script; Cloudflare says it uses no “client-side state (like cookies or localStorage)” for analytics, per its announcement | In scope as a script; low risk, aggregate | Notice, plus an opt-out where your regulator expects one |
| PostHog, cookieless | A script; nothing stored. The IP is used on PostHog’s servers to compute a daily hash | In scope as a script; aggregate, with daily-reset counts | Notice, an opt-out, and an EU project |
| PostHog, default settings | A cookie and localStorage holding an identifier | Consent needed | A banner, or switch to cookieless |
| PostHog Support widget | localStorage: widget session, ticket ID, and the name and email entered, per its JavaScript API | Arguably necessary once someone asks for help; not on every page view | Load it only when a visitor opens support, and say so in the notice |
| Google Analytics 4 | _ga and _ga_<container-id> cookies, two-year default, per Google | Consent needed | Banner plus consent mode |
| Microsoft Clarity | _clck and _clsk first-party cookies, plus third-party cookies, per Microsoft | Consent needed; Microsoft enforces consent signals for the EEA, UK and Switzerland | Banner, and send Clarity the choice |
A few details behind the table:
- GA4 consent mode.
- When
analytics_storageis denied, GA4 “will not read or write first-party analytics cookies” and sends “cookieless pings” with coarse data instead. - In an advanced setup those pings are sent before the visitor chooses. Under the EDPB’s reading of scripts, that is itself access, so prefer the basic setup, which loads nothing until consent.
- Google says it does not log or store individual IP addresses from EU, Swiss or UK users, per its EU data page.
- When
- Clarity and children. Microsoft says Clarity “shouldn’t be used on websites or apps that target users under 18 years of age”, per its overview.
- A form with a bot challenge. If you protect a form with Cloudflare Turnstile, list it with the security cookies.
What the notice should say about analytics
For each tool:
| Item | Example |
|---|---|
| The tool and its operator | ”PostHog, operated by PostHog, Inc.” |
| What it collects | ”Pages viewed, the buttons named below, browser type, and the referring site” |
| What it does not do | ”It stores nothing on your device and does not recognize you on a later day” |
| Why, and the legal basis | ”To learn which pages help visitors; our legitimate interest in improving the site” |
| Where the data is stored | ”In the European Union (Frankfurt)“ |
| How long it is kept | ”One year” |
| How to object | A link or switch that turns measurement off |
Write it before you add the tool, and update it when you change a setting. A notice that says “no cookies” while a tool sets one is worse than no claim at all.
What a banner must do, if you need one
From the GDPR’s consent rules and the EDPB’s cookie banner taskforce report:
- Nothing runs before the choice. Load consent-gated tools only after acceptance.
- Rejecting is as easy as accepting. Put a reject button on the first layer, and use no pre-ticked boxes.
- Choices are specific. Analytics, recording and advertising are separate.
- Withdrawing is as easy as giving (GDPR Article 7(3)), with a link that is always visible.
- The choice reaches the tools. Send it to GA4’s consent mode and to Clarity, and remove what they stored when consent is withdrawn. A banner that records a choice but does not change what runs does nothing.
- You can show the choice. Keep a record of what was accepted and when.
For US visitors, many state laws focus on opting out of sale or sharing rather than on opting in. Honor the Global Privacy Control signal if you share data for advertising.
A sequence that keeps you banner-free as long as possible
- Server side only. Cloudflare HTTP analytics. Publish a notice.
- Add an aggregate, storage-free script. Cloudflare Web Analytics or PostHog in cookieless mode, in an EU project, with autocapture and recording off. Add an opt-out and update the notice first.
- Measure signed-in people from your server, not the browser.
- Add a banner only for tools that need one, such as GA4 or Clarity, and load them only after consent.
- Never load any of it on screens meant for children.
Web Analytics for Product Builders compares what each step tells you. Setting Up PostHog for a Launch shows the PostHog configuration.