# Google Analytics cookies explained: what they are for, and what a banner decides

The CrispStats team · Published 2026-11-29 · Updated 2026-11-29

**TL;DR:** Google's cookie documentation, read on 29 November 2026, says the GA4 tags set first-party cookies: _ga to distinguish users, and _ga_ plus a container id to persist session state, both with a default expiration of 2 years. The same page says the libraries do not require cookies in order to transmit data, and that browsers can shorten cookie life when someone does not return. A banner is a decision about every technology on the page, not about this script alone. This is not legal advice.

A Google Analytics cookie is not the whole of what Google Analytics collects, and it is not the whole of what your page stores. This post is only about the cookies Google's own GA4 documentation names, what they are for, and why a banner decision is bigger than one script. It is general information, not legal advice.

The cookie names and lifetimes below are from Google's page, [GA4 cookie usage on websites](https://support.google.com/analytics/answer/11397207), read on 29 November 2026. What else a default install collects, including when cookies are withheld, is in [what data Google Analytics collects](/blog/what-data-does-google-analytics-collect). The difference between a first-party cookie and a third-party cookie, and how browsers treat each, is in [first-party versus third-party cookies](/blog/first-party-vs-third-party-cookies). This page does not invent further cookie names, and it does not repeat those two guides.

## Which cookies does Google Analytics 4 set?

Google's documentation names two cookies for the GA4 JavaScript tags: `_ga`, and `_ga_` followed by a container id. Both have a default expiration of 2 years. The page says these tags use first-party cookies to distinguish unique users and unique sessions from a single user.

From Google's GA4 cookie usage page, read 29 November 2026. No other analytics cookie names are added here.

| Cookie | Default expiration | What Google's page says it is for |
| --- | --- | --- |
| `_ga` | 2 years | Used to distinguish users |
| `_ga_<container-id>` | 2 years | Used to persist session state |

The container id is part of the second name, so the cookie is not the four characters _ga_ on their own. Google writes it as _ga_ followed by the container id. If a cookie list on your site shows further names, they are not in this table: they may come from a linked Google Ads account, from another tag, or from something else on the page. Google's [advertising and measurement cookies](https://business.safety.google/adscookies/) page is where Google points for the extra cookies set when Ads is linked. This post does not copy names out of it.

## What is each cookie for?

`_ga` is there to distinguish users, and `_ga_<container-id>` is there to persist session state, which is Google's wording on the cookie page. Together they are how the tags tell one browser from another and keep a session attached to that browser across page views.

Distinguishing users means the same browser can be counted once across visits, for as long as the cookie lasts, instead of looking like a new visitor on every request. Persisting session state means hits that belong to one sitting stay in that sitting. Neither cookie, on this description, is the page address, the referrer, or the location derived from an IP address. Those are part of collection, and they are listed in [what data Google Analytics collects](/blog/what-data-does-google-analytics-collect), which is the right page if the question is the payload rather than the cookie.

## Are Google Analytics cookies first-party or third-party?

Google's cookie page says the GA4 tags use first-party cookies. A [first-party cookie](/glossary/first-party-cookie) belongs to the site in the address bar. A [third-party cookie](/glossary/third-party-cookie) belongs to some other domain.

The script can be loaded from Google and still write a first-party cookie on your domain. That is why blocking third-party cookies does not, by itself, remove `_ga`. [First-party versus third-party cookies](/blog/first-party-vs-third-party-cookies) explains that split, and what Safari, Firefox, Chrome and Edge do to each kind. This page does not retread the browser table. First-party is a statement about whose domain the cookie is on. It is not a statement that the cookie is exempt from consent, and it is not a statement that the cookie only does something harmless.

## Does Google Analytics have to set a cookie to send data?

No. Google's cookie page says the libraries do not require you to set cookies to transmit data to Google Analytics. The cookies are how the tags distinguish users and sessions. Transmission of a hit is a separate sentence on the same page.

That sentence is easy to over-read. It does not say a hit without cookies is empty, and it does not say a hit without cookies is harmless. What Google describes sending when a visitor has not accepted cookies depends on the consent setup, and that description is already in [what data Google Analytics collects](/blog/what-data-does-google-analytics-collect). Use that page for the contents of those hits. Use this page for the named cookies. If the cookies are absent, you should not assume the tag sent nothing, and you should not assume it sent the same identifier it would have stored for two years.

## How long do the cookies last?

Google's table gives both cookies a default expiration of 2 years. The same page says browsers enforce their own limits on first-party cookies when a user does not make a return visit: a maximum of 400 days for Chrome and 7 days for Safari.

So the default on the cookie and the life the browser allows are not the same number. A two-year default can be cut by the browser under the condition Google states, which is a user who does not return. Google also lets you override the expiration, from immediately to 25 months, and it says cookie settings in the global site tag or in Google Tag Manager override the settings in the Analytics interface. The finer browser-by-browser rules, beyond the sentence on Google's cookie page, are in [first-party versus third-party cookies](/blog/first-party-vs-third-party-cookies). Changing the expiration does not change the category of the cookie.

## Does the banner decision depend on the analytics script alone?

No. A cookie banner decision depends on the whole page: every script that stores or reads something on the device, and every collection purpose, not on the Google tag in isolation. Removing or keeping one analytics script does not settle the page.

Example. A shop loads the Google tag, a chat widget that sets its own cookie, and an ad pixel. The banner is the visitor's answer to that combination. Accepting or refusing it is not a switch labelled only for analytics, unless you built the banner that way and the other tools really do wait. [Do you need a cookie banner for analytics](/blog/do-you-need-a-cookie-banner-for-analytics) is the longer treatment of the analytics part of the question, by region and with the limits of what a vendor can claim. It is still not a ruling on your page. Your counsel looks at the full list. This post will not tell you that you do, or do not, need a banner.

- **List every cookie in a private window**, before and after any consent click, not only the two in Google's table.
- **Include embeds, chat, ads and payment widgets.** They are part of the page even when they are not part of the analytics tag.
- **Do not treat a first-party label as the end of the question.** Purpose is what the banner is about, which the first-party guide says plainly.

> **Not legal advice.** Nothing here is legal advice. Cookie rules depend on where the visitor is, what the cookie is for, and what else the page does. The linked guides collect published sources. They do not decide your site.

## What extra cookies appear when Google Ads is linked?

Google's cookie page says that when a GA4 property is linked to a Google Ads account, the tags set additional cookies, used to give Google Ads a more reliable way to measure interactions with your business. It does not list those names in the GA4 cookie table. It points to a separate advertising and measurement cookies page.

That is as far as this post goes on names. The table above stays at the two cookies Google lists for GA4 tags. If Ads is linked, expect more cookies than those two, and read them on [Google's advertising and measurement cookies page](https://business.safety.google/adscookies/) rather than from a secondary summary. Linking Ads is also a change to the banner question, because the page is no longer 'analytics only'. The collection side of advertising features is part of [what data Google Analytics collects](/blog/what-data-does-google-analytics-collect).

## What is different if the analytics tool sets no cookies?

A tool that sets no cookies does not add `_ga` or `_ga_<container-id>` to the page, and it does not distinguish returning users for two years with those cookies. CrispStats sets no cookies in its default setup, does not store IP addresses, and does not store raw user agents. How the counting works without a cookie is in [cookieless analytics explained](/blog/cookieless-analytics-explained). The product side of that setup is [cookieless analytics](/analytics/cookieless-analytics).

The absence of an analytics cookie is not, by itself, the absence of a banner. Other tools on the same page can still store something, which is the point of the previous section. A cookieless analytics script also does not erase Google's cookies if the Google tag is still on the page. Run one or the other, or know that you are running both and that the banner still has to account for whatever remains. The trade-off, spelled out in the cookieless guide rather than here, is that a visitor who returns tomorrow is not recognised by the default daily hash.

## Frequently asked questions

### What are the Google Analytics 4 cookies called?

Google's cookie page, read on 29 November 2026, names _ga, used to distinguish users, and _ga_ followed by a container id, used to persist session state. Both default to 2 years. This page does not add other names.

### Are Google Analytics cookies first-party or third-party?

Google says the GA4 tags use first-party cookies. The script can come from Google and still write the cookie on your domain. First-party describes the domain. It does not, by itself, answer whether you need consent.

### Does Google Analytics need a cookie to send any data?

Google's cookie page says the libraries do not require cookies to transmit data. The cookies are for distinguishing users and sessions. What a hit contains when cookies are off is covered in the guide to what Google Analytics collects, and it depends on the consent setup.

### Do I need a cookie banner because of Google Analytics alone?

Not as a question this page can answer. A banner depends on the whole page, including ads, chat, embeds and any other storage, not on one script. This is not legal advice. The cookie banner guide collects the published reasoning for analytics specifically.

### How long does the Google Analytics cookie last?

The default in Google's table is 2 years for both cookies. Google also says browsers limit first-party cookie life when a user does not return, up to 400 days in Chrome and 7 days in Safari, and that you can override the expiration from immediately to 25 months.
