Blog
Do you need a cookie banner for Google Analytics?
Short answer: yes, in the EU and UK. Google Analytics sets cookies, and EU law requires consent before a script can set them. Here is why, and how a cookieless analytics tool removes the banner entirely.
Published August 2026
Why Google Analytics needs a cookie banner
Google Analytics 4 sets cookies on a visitor’s device. The main ones are _ga and _gid, used to recognise a visitor across page loads and sessions. Under the EU’s ePrivacy Directive, a website needs consent before it can set cookies or access a visitor’s device, with a narrow set of exceptions that analytics does not qualify for. The GDPR then governs what happens to the personal data those cookies create.
In practice, that means every site in the EU and UK that runs Google Analytics must show a cookie banner and get valid opt-in before the GA script loads. Running the script before consent is given is itself the breach, even if visitors later consent.
What you lose to the consent banner
A cookie banner is a conversion tax. Every visitor who clicks "reject all" is excluded from your analytics, and every visitor who clicks "accept" had to dismiss a pop-up before they could read your page. In EU markets, a significant share of visitors reject, which means a significant share of your real traffic never makes it into your reports.
This is the "consent data gap": the difference between your actual traffic and what a cookie-based tool reports. It is the reason many teams end up running a privacy-friendly tool alongside GA, to see the traffic GA loses.
How a cookieless tool removes the banner
A cookieless analytics tool takes a different path: it sets no cookies and stores no personal data on the visitor’s device. Because no cookies are set and no device access happens, the ePrivacy consent requirement does not apply. You embed one script tag and you are done. No banner, no consent management platform, no "accept all" pop-up between your visitor and your content.
Visitor identification is done with a short-lived, salted hash of non-personal signals (IP, user agent, domain) that resets daily, so the same person cannot be followed over time. The raw IP is discarded. What remains is the aggregate data you actually need: how many people visited, where they came from, what they looked at.
Cookieless vs. cookie-based: the banner question
| Google Analytics | Cookieless (MetriXs) | |
|---|---|---|
| Sets cookies | Yes (_ga, _gid) | No |
| Cookie banner required (EU/UK) | Yes | No |
| Visitors who reject consent | Excluded from data | Measured (no consent step) |
| Consent management platform | Required | Not needed |
| GDPR lawful basis for the cookie | Consent | N/A (no cookie) |
So do you need a cookie banner?
If you run Google Analytics in the EU or UK, yes, you need a cookie banner and valid consent before the script loads. If you switch to a cookieless analytics tool that sets no cookies and stores no personal data, you do not. That is the whole appeal: compliance by architecture, not by configuration you have to maintain on every page.
MetriXs is a cookieless, EU-hosted analytics tool with a free plan. It sets no cookies, stores no IP addresses, and needs no consent banner. See how it works or compare it with Google Analytics.
Frequently asked questions
- Do I need a cookie banner for Google Analytics?
- Yes, in the EU and UK. Google Analytics sets cookies, and the ePrivacy Directive requires consent before a script can set cookies or access a device. So you must show a consent banner and get valid opt-in before the GA script loads.
- Can I run Google Analytics without a cookie banner?
- Only with significant configuration and legal risk. If you want no banner at all, use a cookieless analytics tool that sets no cookies and stores no personal data, so the ePrivacy consent requirement does not apply.
- What happens to visitors who reject the cookie banner?
- With a cookie-based tool like Google Analytics, visitors who reject consent are excluded from measurement. A cookieless tool measures everyone because there is no consent step to reject.
- Is a cookieless analytics tool really GDPR compliant without a banner?
- Yes, when it stores no personal data. The ePrivacy consent requirement is triggered by cookies or access to a device. A cookieless tool that sets no cookies and stores no personally identifiable data falls outside that requirement.
Drop the cookie banner
MetriXs is cookieless, GDPR compliant, and hosted in the EU. Free plan, paid from €6/month.
Start free trial →Related: Cookieless web analytics, explained · GDPR-compliant analytics · Google Analytics alternatives