Does GA4 Use Cookies? Analytics & Consent Explained
Does GA4 use cookies? Yes — Google Analytics 4 sets first-party cookies to recognise visitors and stitch together sessions, even though Google also markets it as working "cookieless." Both things are true at once, and the gap between them is exactly where sites get their consent wrong. This guide names the exact cookies GA4 sets, how long they last, when you legally need consent before they fire, and the two catches most analytics guides skip entirely: the honest GDPR status in 2026, and the US wiretapping angle that has nothing to do with cookies at all.
_ga and _ga_<id> — both default to a 2-year lifespanYes, GA4 uses cookies — specifically first-party cookies set on your own domain, chiefly _ga and _ga_<container-id>. They identify returning visitors and maintain session state, and both default to a two-year lifespan. GA4 can also run in a cookieless mode (via Google Consent Mode), where it sends anonymised "pings" instead of reading or writing cookies — but that's a specific configuration, not the default, and "cookieless" does not mean "consent-free."
Because analytics cookies are non-essential, EU and UK rules generally require prior consent before GA4 sets them. And in the US, a separate risk applies regardless of cookies: how GA4 shares data can raise wiretapping exposure. Both matter, and they're different problems.
What this guide covers
Which cookies GA4 actually sets
GA4 is lighter on cookies than the old Universal Analytics was — notably, the short-lived _gid cookie from Universal Analytics is gone in GA4. What remains are a small set of first-party cookies, with two doing nearly all the work.
| Cookie | What it does | Default duration | Party |
|---|---|---|---|
_ga | Distinguishes unique users (the core client ID) | 2 years | First-party |
_ga_<container-id> | Persists session state for a specific GA4 property | 2 years | First-party |
_gac_<id> | Appears when GA4 is linked to Google Ads (campaign/conversion data) | ~90 days | First-party |
Two things to note. First, these are first-party cookies — set on your own domain by the tag on your site, not by a google.com domain. Second, the default two-year lifespan is adjustable: in GA4's data-stream settings you can shorten it (down to as little as session-only, up to a 25-month maximum), and browsers may cap it anyway — Chrome limits non-returning-visitor cookies to around 400 days, and Safari's tracking prevention can cut first-party script-set cookies to roughly 7 days. Linking Google Ads or other Google products can introduce additional cookies beyond the three above.
Crucially, Google also states that the GA4 libraries do not require cookies to transmit data. The cookies mainly exist to recognise returning visitors and link sessions together; the measurement calls themselves can happen without them. That fact is the hinge for the whole "cookieless" discussion below.
First-party doesn't mean exempt
A common misreading: "GA4's cookies are first-party, so I don't need consent for them." That conflates two separate questions. First-party vs third-party is about who sets the cookie and on which domain. Essential vs non-essential is about whether the cookie is strictly necessary to deliver what the user asked for. Consent law keys off the second question, not the first.
Analytics cookies — first-party or not — are non-essential: a visitor can read your page perfectly well without GA4 ever recognising them. As the plain test goes, analytics cookies "are not needed to deliver the page the visitor asked for." That's why, under the EU's ePrivacy rules and the GDPR, storing or reading them generally requires prior consent, exactly as it would for an advertising pixel. Being first-party changes the cookie's resilience to browser blocking; it does not change the consent obligation.
So "it's just first-party analytics" is not a compliance position. The question that matters is whether GA4's cookies are strictly necessary (they aren't), and therefore whether you obtained consent before they fired (you need to).
The "cookieless" question: what Consent Mode really does
Google markets GA4 as able to run "cookieless," and that's where confusion peaks. The mechanism is Google Consent Mode, which governs GA4's storage behaviour through a signal called analytics_storage. When that signal is set to "denied," the GA4 tag does not read or write its analytics cookies. Instead, it can send cookieless pings — stripped-down, anonymised hits that Google uses to model (statistically estimate) the behaviour and conversions it can no longer observe directly.
There are two flavours. Basic consent mode doesn't load the Google tags at all until the visitor consents, so a declining visitor produces no data. Advanced consent mode loads the tags with consent denied by default and sends those cookieless pings until (and unless) the visitor consents — which is why, with advanced mode, a chunk of your GA4 reporting becomes modelled rather than directly measured.
The trap is treating "cookieless" as "consent-free." A cookieless ping is still a transmission of data about the visitor to Google. Whether that specific transmission needs consent is a live and jurisdiction-dependent question — not an automatic exemption. Running advanced consent mode can reduce your cookie exposure while leaving a data-transfer question open.
When you actually need consent for GA4
Whether you need consent before GA4 sets its cookies depends on where your visitors are — and the answer is "usually yes" in the places with the strictest rules.
- EU and UK. Generally yes. GA4's analytics cookies are non-essential, and ePrivacy rules plus the GDPR require prior consent before non-essential cookies are stored or read. In practice that means GA4 should not fire its cookies until the visitor opts in — the prevention-first pattern — and Consent Mode is how you wire that choice through to the tag.
- France (CNIL), specifically. France offers a narrow audience-measurement exemption that can let certain analytics run without consent — but only under strict conditions, including a cookie lifetime capped at 13 months. GA4's two-year default blows past that, and the CNIL has said plainly that "most large audience measurement offerings do not fall within the scope of the exemption." So the exemption rarely rescues a standard GA4 install.
- United States. There's no single federal cookie-consent law, so GA4 cookies aren't gated the way they are in the EU. But several state privacy laws (California's CCPA/CPRA and others) give consumers opt-out rights over certain tracking and sale/sharing of data — and, as we'll see, a separate US theory (wiretapping) can apply regardless of cookies.
The simplest safe posture for a site with any EU/UK traffic: treat GA4 as requiring prior consent, don't rely on the French exemption, and don't assume "first-party" or "cookieless" removes the obligation.
Is your GA4 firing before anyone consents?
The only way to know whether your GA4 cookies fire before or after consent is to look. Our free scanner loads your site in a real browser and shows which trackers — GA4 included — fire before consent, in about 10 seconds, mapped to CIPA, CCPA and GDPR. No account.
Scan your site free →Is GA4 GDPR-compliant in 2026? The honest answer
This is where most competitor articles give you a confident yes or a confident no, and both are wrong. The accurate 2026 answer is "defensibly yes — if configured correctly — but with an unresolved footnote." Here's the real arc, because the history matters.
In 2022, several EU data-protection authorities — Austria's DSB (January), France's CNIL (February), and Italy's Garante (June) — ruled that specific websites' use of Google Analytics violated the GDPR, because it transferred personal data to the US without adequate safeguards after the Schrems II judgment struck down Privacy Shield. For a stretch, "Google Analytics is illegal in Europe" was a fair summary of the risk.
What changed was the EU-US Data Privacy Framework (DPF), which the European Commission adopted on 10 July 2023. Certified US companies — Google among them — gained a clearer legal basis for transatlantic data transfers, addressing the central objection in those 2022 rulings. That's why the flat "GA is illegal in the EU" claim is now out of date.
The DPF addressed the transfer mechanism, but it didn't end the debate. Privacy advocates (notably noyb) are challenging it, and a "Schrems III" ruling is widely expected in the coming years; no DPA has formally reversed its 2022 decision, so those remain precedent in their jurisdictions. The practical read: GA4 with Consent Mode v2, a valid consent banner, EU-region data settings and current transfer safeguards is defensibly compliant today — but it's a managed risk, not a closed question. Anyone who tells you it's simply "fine" or simply "banned" is skipping the footnote.
And there's a quieter failure point that sits entirely on your side: the consent banner itself. A large share of EU consent banners fail one or more GDPR requirements, and a banner that doesn't actually block GA4 until consent — or that nudges users toward "accept" — passes its own non-compliance straight through to your analytics. The tool can be configured correctly and still be unlawful because the gate in front of it leaks.
The US catch most GA4 guides skip: CIPA
Here's the angle you won't find on the typical "does GA4 use cookies" page, and it's the one with teeth in the US. California's Invasion of Privacy Act (CIPA) — a wiretapping statute — is being used to sue websites whose analytics and tracking tools route a visitor's activity to a third party without consent. And this theory doesn't depend on cookies at all. It depends on the data flow: is a visitor's interaction being shared with an outside party, in a way that looks like interception?
That's why GA4 can carry US risk even in a cookieless configuration. The question a CIPA claim asks isn't "did you set a cookie?" — it's "did Google receive this visitor's data as a third party, without consent?" GA4's data-sharing settings, which can make Google a recipient of your visitors' data for its own purposes, are what tip it from a first-party measurement tool into potential third-party interception territory. Cookieless pings still send data; server-side GA4 still forwards it. The cookie question and the wiretapping question are genuinely separate.
Most GA4 content answers "does it use cookies?" and stops. The sharper, US-relevant point is that the cookie is only half the risk. Even a cookieless GA4 can create CIPA exposure through data sharing, and a consent banner that merely discloses GA4 doesn't satisfy the prior consent both CIPA and GDPR want. We go deep on the litigation side — the data-sharing settings, the cases naming Google Analytics, and the compliant configuration — in Google Analytics & CIPA compliance.
How to run GA4 the right way
You don't have to drop GA4 to be compliant — you have to gate it and configure it deliberately. A practical sequence:
1 — Gate GA4 behind real consent
- Don't let GA4 set cookies or send data until an EU/UK visitor consents. Use a consent banner that actually blocks the tag, not one that only describes it.
- Wire the choice through with Google Consent Mode v2 so
analytics_storagereflects the real decision.
2 — Tighten the cookie and data settings
- Shorten cookie retention from the two-year default where you can, and don't rely on France's 13-month exemption for a standard install.
- Review GA4's data-sharing settings — these are what create third-party/CIPA exposure. Turn off what you don't need.
3 — Keep the transfer story straight
- Use EU-region data settings and current transfer safeguards; treat the DPF as a managed basis, not a guarantee.
- Disclose GA4 accurately in your privacy policy — but remember disclosure is not consent.
4 — Verify, don't assume
- Test in a fresh incognito window: does GA4 fire before you click the banner? Does "reject" actually stop it?
- Re-check after any tag or site change — a GTM tweak can quietly reopen the gap.
The quickest first step is to see what GA4 is doing on your live site right now, because the settings in your GA4 admin and the behaviour in a visitor's browser aren't always the same thing.
Key takeaways
- Yes, GA4 uses cookies — first-party
_gaand_ga_<id>, both defaulting to two years (GA4 dropped Universal Analytics'_gid). - First-party isn't exempt. Analytics cookies are non-essential, so EU/UK rules generally require prior consent before GA4 sets them — being first-party changes nothing about that.
- "Cookieless" ≠ consent-free. Consent Mode's denied state skips cookies and sends modelled cookieless pings, but those still transmit data to Google.
- France's exemption rarely helps: it caps cookie life at 13 months, and GA4's 2-year default exceeds it; the CNIL says most large analytics tools don't qualify.
- GDPR status in 2026 is "defensibly yes, with a footnote": the 2022 "illegal" rulings were eased by the 2023 Data Privacy Framework, but a Schrems III challenge is pending — it's a managed risk, configured correctly.
- The US catch is CIPA, and it's cookie-independent: GA4's data sharing can make Google a third-party recipient, which is the wiretapping theory — even in a cookieless setup.
Frequently asked questions
Does GA4 use cookies?
Yes. Google Analytics 4 sets first-party cookies on your own domain, chiefly _ga (which distinguishes unique users) and _ga_<container-id> (which persists session state for a specific property), both defaulting to a two-year lifespan. Linking Google Ads can add others, such as _gac_. GA4 is lighter on cookies than the older Universal Analytics — it no longer uses the _gid cookie. GA4 can also run in a "cookieless" mode via Google Consent Mode, where it sends anonymised pings instead of reading or writing cookies, but that's a specific configuration rather than the default, and cookieless does not mean consent-free. This is general information, not legal advice.
What cookies does GA4 set, and how long do they last?
The core GA4 cookies are _ga and _ga_<container-id>, both first-party and both defaulting to two years. If you link GA4 to Google Ads you may also see _gac_<id>, which typically lasts around 90 days. You can shorten the _ga retention in GA4's data-stream settings — anywhere from session-only up to a 25-month maximum — and browsers may shorten it further regardless: Chrome caps cookies for non-returning visitors at roughly 400 days, and Safari's tracking prevention can reduce script-set first-party cookies to about 7 days. Note that GA4 does not require cookies to transmit data; the cookies mainly recognise returning visitors and link sessions.
Do I need consent to use GA4?
In the EU and UK, generally yes. GA4's analytics cookies are non-essential — a visitor can use your site without them — so ePrivacy rules and the GDPR require prior consent before they're set, the same as for an advertising pixel. The fact that they're first-party cookies does not change this. France offers a narrow audience-measurement exemption, but it caps cookie lifetime at 13 months (below GA4's 2-year default), and the CNIL has said most large audience-measurement tools don't qualify. In the US there's no federal cookie-consent law, but state laws grant opt-out rights and a separate wiretapping theory (CIPA) can apply to GA4's data sharing. The safe posture for any site with EU/UK traffic is to gate GA4 behind consent. This is general information, not legal advice.
Is "cookieless" GA4 exempt from consent?
Not automatically. When Google Consent Mode sets analytics_storage to denied, GA4 stops reading and writing its cookies and instead sends cookieless pings that Google uses to model behaviour and conversions. That reduces your cookie exposure, but a cookieless ping is still a transmission of data about the visitor to Google, so whether it needs consent is a live, jurisdiction-dependent question rather than a blanket exemption. "Advanced" consent mode in particular loads the tag with consent denied and sends these pings by default, which is why part of GA4's reporting becomes modelled. Treat cookieless as reducing one risk (cookies) while leaving a separate question (data transfer) open.
Is Google Analytics GDPR-compliant in 2026?
The honest answer is "defensibly yes, if configured correctly, with an unresolved footnote." In 2022, several EU regulators (Austria, France, Italy) ruled specific uses of Google Analytics unlawful because of US data transfers after Schrems II. The EU-US Data Privacy Framework, adopted in July 2023, gave certified US companies including Google a clearer transfer basis, which is why the flat "GA is illegal in Europe" claim is outdated. But the Framework is being challenged (a "Schrems III" ruling is widely expected), and no DPA has formally reversed its 2022 decision. So GA4 with Consent Mode v2, a valid consent banner, EU-region settings and current safeguards is a managed risk that's defensible today — not a settled certainty. This is general information, not legal advice.
Can GA4 create a CIPA wiretapping problem even without cookies?
Yes, and this is the most overlooked point. California's Invasion of Privacy Act (CIPA) is a wiretapping theory that turns on the data flow, not the cookie: the question is whether a visitor's activity is shared with a third party without consent, in a way resembling interception. GA4's data-sharing settings can make Google a recipient of your visitors' data for its own purposes, which is what shifts it from first-party measurement toward potential third-party exposure. Because that transfer can happen through cookieless pings or server-side forwarding, a cookieless GA4 configuration does not automatically remove the CIPA risk. The cookie question and the wiretapping question are separate, and you have to address both. This is general information, not legal advice.
The bottom line
Does GA4 use cookies? Yes — first-party _ga and _ga_<id>, two years by default — and it can also run cookieless through Consent Mode. But the cookie answer is the easy part. The part that actually decides your exposure is consent: analytics cookies are non-essential, so in the EU and UK you generally need prior consent before GA4 fires, "first-party" doesn't exempt you, and "cookieless" doesn't either.
Then there are the two catches the quick guides skip. GA4's GDPR status in 2026 is defensible with the right configuration but not a closed question, and in the US the real risk is a wiretapping theory that ignores cookies entirely and looks at who receives your visitors' data. Gate GA4 behind genuine consent, tighten its data-sharing and retention, keep your transfer story current — and verify what it actually does in a browser, not just what the admin panel claims. Get that right and you keep your analytics without inheriting the liability that usually rides along with it.
See whether your GA4 fires before consent
Scan your site free to see which trackers — GA4 included — fire before consent, in about 10 seconds, mapped to CIPA, CCPA and GDPR. Then run ConsentPixel — Privacy · Verified free for 14 days: prevention-first consent that actually blocks GA4 until the visitor agrees, wired through Consent Mode, with a per-visitor record that proves it. Any platform.
Scan your site free →Related reading
- Google Analytics & CIPA compliance — the US litigation angle, data-sharing settings, and the compliant GA4 configuration
- Is a cookie banner enough? — why a banner that doesn't block GA4 doesn't protect you
- A consent platform isn't enough — the enforcement gap that leaves GA4 firing before consent
- Server-side tagging & consent — why server-side GA4 doesn't bypass the consent gate
- CIPA lawsuit tracker — the wiretapping cases behind the US risk
ConsentPixel — Privacy · Verified builds prevention-first consent tooling that blocks non-essential trackers — GA4 included — until visitors genuinely consent, on any platform, and proves consent came first. This article is educational and general information, not legal advice; ConsentPixel is not a law firm. GA4's behaviour and the legal landscape change over time; verify against Google's current documentation and qualified counsel.
_ga and _ga_<container-id> (2-year default, adjustable to a 25-month maximum), plus _gac_ when linked to Google Ads; GA4 does not use Universal Analytics' _gid; Google states the GA4 libraries do not require cookies to transmit data; browser caps include ~400 days (Chrome) and ~7 days (Safari ITP). Consent Mode governs storage via analytics_storage, with cookieless pings and modelled data when denied. Consent requirements reflect EU/UK ePrivacy and GDPR (analytics cookies as non-essential) and France's CNIL audience-measurement exemption (13-month cap; CNIL guidance that most large audience-measurement tools don't qualify). GDPR status references the 2022 DPA decisions (Austria DSB Jan 2022; CNIL Feb 2022; Garante Jun 2022) and the EU-US Data Privacy Framework (adopted 10 July 2023), with the ongoing "Schrems III" challenge. CIPA references California Penal Code §631/§637.2 ($5,000 per violation). Specifics change over time and vary by configuration and jurisdiction — verify at the source. This is general information, not legal advice.