Analytics vendor · Google LLC
Google Analytics 4 Cookies: List With Purpose and Retention
Last verified 2026-10-16 · Updated 2026-10-17
On this page
Cookies Google Analytics 4 Sets on Your Site
Google Analytics 4 sets 2 cookies on a site by default, _ga and _ga_<container-id>, and older Universal Analytics tags set up to 9 more. Universal Analytics stopped processing data on 1 July 2023. A _gid, _gat, or __utma cookie on your site today points to an old tag that still runs and sends data nowhere useful.
Rows marked "older version" come from earlier versions of Google Analytics 4 that still run on some sites.
| Name | Type | Category | Party | Retention | What it does |
|---|---|---|---|---|---|
_ga | Cookie | Analytics | First-party | 2 years (730 days) | The _ga cookie is a Google Analytics 4 analytics cookie that tells visitors apart for 2 years and needs consent under the ePrivacy Directive. |
_ga_<container-id> | Cookie | Analytics | First-party | 2 years (730 days) | The _ga_<container-id> cookie is a Google Analytics 4 analytics cookie that keeps session state for 2 years and needs consent under the ePrivacy Directive. |
__utm<letter> older version | Cookie | Analytics | First-party | from 10 minutes to 2 years | The __utma, __utmb, __utmc, __utmt, __utmz, and __utmv cookies come from ga.js, the Google Analytics library Google replaced in 2013. |
_dc_gtm_<property-id> older version | Cookie | Analytics | First-party | 1 minute (60 seconds) | The _dc_gtm_<property-id> cookie is the Google Tag Manager version of the _gat cookie, which limited the request rate for 1 minute. |
_gat_<property-id> older version | Cookie | Analytics | First-party | 1 minute (60 seconds) | The _gat cookie is a Universal Analytics cookie that limited the request rate to Google Analytics for 1 minute. |
_gid older version | Cookie | Analytics | First-party | 1 day | The _gid cookie is a Universal Analytics cookie that identified a browser for 24 hours, and Google Analytics 4 no longer sets it. |
Scripts, Pixels, and Endpoints Google Analytics 4 Loads
Google Analytics 4 loads 6 known scripts, pixels, and data endpoints. Each row gives the host to look for in the Network tab of Chrome DevTools or in a cookie scanner report.
| Type | Resource | Host | What it does |
|---|---|---|---|
| Script | Google tag for Google Analytics 4 (gtag.js) | www.googletagmanager.com | The Google tag loads Google Analytics 4 on the page and writes the _ga and _ga_<container-id> cookies. |
| Data endpoint | Google Analytics 4 collection endpoint | region1.google-analytics.comwww.google-analytics.comanalytics.google.com | The collection endpoint receives every page view and event, with the client ID from the _ga cookie in the cid parameter. |
| Data endpoint | Google signals collection endpoint | stats.g.doubleclick.net | Google Analytics 4 sends measurements to stats.g.doubleclick.net while Google signals is on, which links visits to signed-in Google accounts. |
| Pixel | Google Analytics audiences pixel | www.google.comwww.google.frwww.google.de | The ga-audiences pixel adds the visitor to Google Ads remarketing audiences built in Google Analytics, and the TermsFeed website auditor found the pixel firing after consent on scanned sites. |
| Script | Universal Analytics library (analytics.js) | www.google-analytics.com | The analytics.js library ran Universal Analytics and wrote the _ga, _gid, and _gat cookies. |
| Data endpoint | Universal Analytics collection endpoint | www.google-analytics.com | The Universal Analytics endpoint received hits from analytics.js until 1 July 2023. |
Does Google Analytics 4 Need Consent?
Yes, the Google Analytics 4 cookies need consent in the EU, need consent in the UK unless the statistics exception covers your setup, and need no prior opt-in in California. The table gives the rule for each law, taken from the page of the _ga cookie.
| Law | Consent before the cookies are set | Opt-out right | Source |
|---|---|---|---|
| EU ePrivacy Directive + GDPR | Required | Withdraw at any time | Article 5(3), ePrivacy Directive |
| UK PECR | Required unless exempt | Withdraw at any time | Regulation 6 and Schedule A1, PECR |
| California CCPA | No general opt-in | None while the vendor acts as a service provider | Cal. Civ. Code 1798.120 |
The consent table describes what each law requires and is not legal advice. Whether a law applies to your site depends on where your visitors are, where your business is based, and how you set up Google Analytics 4, such as Google signals and the data sharing settings of the account.
Read the reason for each answer in the consent rules for the _ga cookie.
How to Add Google Analytics 4 to a Consent Banner
Add Google Analytics 4 to a consent banner by holding back the Google tag (gtag.js) until the visitor accepts analytics cookies. Both TermsFeed products block Google Analytics 4 in the Analytics category.
Add Google Analytics 4 to TermsFeed Free Cookie Consent
TermsFeed Free Cookie Consent runs a tagged script only after the visitor accepts its category. Change type="text/javascript" to type="text/plain" and add data-cookie-consent="tracking".
<script type="text/plain" data-cookie-consent="tracking" async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script>
<script type="text/plain" data-cookie-consent="tracking">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'TAG_ID');
</script>
Cookie Consent is free and needs no account. Build your free consent banner with TermsFeed Free Cookie Consent.
Add Google Analytics 4 to TermsFeed Privacy Consent
Add Google Analytics 4 from its template in TermsFeed Privacy Consent, and Privacy Consent loads the Google tag and sends Google Consent Mode v2 for you. Type your measurement ID, which starts with G-, and the template fills the vendor, the Analytics vendor category, and the consent signals.
The Google Analytics 4 template asks for the Measurement ID and fills every other field of the vendor. Pick the "Google Analytics 4" card under Analytics, enter the Measurement ID, and click "Add Google Analytics 4". Find the Measurement ID in Google Analytics under Admin › Data streams › your web stream. The illustration shows the template form in the TermsFeed app.
Privacy Consent detects the location of each visitor and records every answer in a consent log. Set up Google Analytics 4 from its template with TermsFeed Privacy Consent.
Follow every step, the vendor settings, and the check in Chrome DevTools in how to block the _ga cookie.
Who Runs Google Analytics 4
Google LLC runs Google Analytics 4 from the United States, and Google Ireland Limited provides the service to businesses in the European Economic Area (EEA) and Switzerland. Google Analytics 4 runs under the Google Ads Data Processing Terms, which you accept in the Google Analytics account settings.
Read how Google LLC handles the data in the Google Analytics 4 privacy policy, and sign the Google Ads Data Processing Terms, which cover Google Analytics before you collect data from visitors in the EU or the UK. Both documents appear in the sources at the end of this page.
Google Analytics 4 Cookie FAQs
Does Google Analytics 4 need consent?
Yes, the Google Analytics 4 cookies need consent in the EU, need consent in the UK unless the statistics exception covers your setup, and need no prior opt-in in California. Firstly, the ePrivacy Directive requires consent before a site sets the analytics cookies of Google Analytics 4. Secondly, the UK PECR requires consent for the analytics cookies of Google Analytics 4 unless the statistics exception covers your setup. Thirdly, the CCPA sets no general opt-in requirement for the analytics cookies of Google Analytics 4, and the table gives the opt-out right of visitors. The consent section of this page gives the table for each law.
How long do Google Analytics 4 cookies last?
Each cookie of Google Analytics 4 in the current setup lasts 2 years (730 days). The retention column of the cookie list gives the lifetime of each cookie.
How do I block Google Analytics 4 cookies?
Block the Google Analytics 4 cookies by holding back the Google tag (gtag.js) until the visitor accepts analytics cookies. Tag the Google tag (gtag.js) with data-cookie-consent="tracking" in TermsFeed Free Cookie Consent, or add Google Analytics 4 as a vendor in TermsFeed Privacy Consent. The page of the _ga cookie gives the full steps and the settings of Google Analytics 4.
Sources for the Google Analytics 4 Cookies
The facts on this page come from the documentation Google publishes, checked on 2026-10-16. The list gives every source, so you check each fact yourself.
- Google Analytics Help, Google Analytics cookie usage on websites
- Google Tag Platform, Customize cookies
- Google Tag Platform, Consent mode overview
- CNIL, Sheet n°16: Use analytics on your websites and applications
- GDPR, Recital 30
- TermsFeed website auditor scans, 9 October 2026 (internal)
- Google Analytics Help, About Google Analytics sessions
- Google Analytics 4 privacy policy
- Google Ads Data Processing Terms, which cover Google Analytics