DataDad.

Guide · Updated

Google Analytics and GDPR: cookies and consent.

GA4 sets cookies that last two years, so EU sites ask first. Here is what the rules say, what Consent Mode v2 changed, and a banner-free option.

A switch with a shield on one side and a cookie on the other.

Google Analytics cookies

Which cookies does Google Analytics set?

On a website, Google Analytics 4 sets two first-party cookies through the Google tag.

Cookies set by Google Analytics 4 on websites
CookieLastsUsed to
_ga2 yearsTell users apart
_ga_<container-id>2 yearsKeep the session state

When you link GA4 to Google Ads, it can set more advertising cookies. Source: [GA4] Cookie usage on websites.

Data transfers

Is Google Analytics GDPR compliant?

Two questions decide it: can EU data go to Google in the US, and did the visitor agree to the cookies? The first answer changed over time. The second did not.

  1. Privacy Shield ends. The EU Court of Justice strikes down the framework for EU–US data transfers (Schrems II, C-311/18).

  2. Austria. The data protection authority finds that a website's use of Google Analytics breaks the GDPR because of its transfers to the US (noyb).

  3. France. The CNIL orders a website to bring its Google Analytics use into line with the GDPR, or stop it (noyb).

  4. Italy. The Garante reaches the same finding and gives Italian websites 90 days to comply (Garante).

  5. A new framework. The European Commission adopts the EU–US Data Privacy Framework (Decision 2023/1795). Google LLC is certified under it (Google).

  6. Upheld. The EU General Court dismisses a challenge to the framework (Latombe v Commission, T-553/23). An appeal is pending at the Court of Justice.

Today, transfers to Google rely on the Data Privacy Framework. The cookie question is unchanged: in the EU, Google Analytics needs consent before it sets cookies.

FAQ

Google Analytics and GDPR, answered.

Does Google Analytics 4 use cookies?

Yes. On websites, GA4 sets _ga to tell users apart and _ga_<container-id> to keep the session state. Both last two years by default.

Does Google Analytics need a cookie banner?

In the EU, yes. The ePrivacy Directive asks for consent before a site stores cookies that are not strictly necessary, and analytics cookies are not. In the UK, since 5 February 2026, cookies used only for statistics about your own site can be used without consent if visitors can object.

Does Consent Mode v2 replace the cookie banner?

No. Consent mode passes the choice a visitor makes in your cookie banner to Google's tags. You still need the banner.

Is Google Analytics GDPR compliant?

Two questions decide it. Transfers of EU data to Google in the US have relied on the EU–US Data Privacy Framework since 10 July 2023. Its cookies still need consent in the EU.

Is there web analytics that needs no cookie banner?

Yes. DataDad is cookieless by default: it sets no cookies and stores no IP addresses, so there is no consent banner for analytics.

Also in DataDad

Analytics without the paperwork.

Join the closed beta.

Tell us a little about what you're building.

Request access

We use these details to review your request and contact you.