
In short
In 2025 Google switched the GA4 session cookie (_ga_<container-id>) from the GS1 format to GS2, which stores labelled key-value pairs such as session ID, session number and engagement. Sites using GTM or gtag.js need no changes. Only custom code that parses GA4 cookies, for example for the Measurement Protocol, must be tested and updated.
Contents6 sections
Google Analytics 4 (GA4) uses first-party cookies to manage sessions and identify returning users, as part of a more privacy-conscious approach to measurement. In 2025 Google changed the format of the GA4 session cookie from GS1 to GS2. This post explains what each GA4 cookie does, how to read the new value and who needs to act.
The main GA4 cookie is _ga, which stores a Client ID: a unique, randomly generated identifier for each browser. The Client ID lets GA4 tell new and returning visitors apart and follow user journeys over time.
Which cookies does GA4 set?
Google's GA4 cookie list includes two cookies, both with a default lifespan of 2 years:
_ga: used to distinguish users. It stores a unique random number for each browser to identify repeat visits.

_ga_<container-id>: used to persist session state. It tracks activity within a visit, which GA4 uses for session counts, session duration and engagement.

You may also see a _gid cookie with a 24-hour lifespan. It belonged to Universal Analytics (analytics.js) and is not in Google's GA4 cookie list, so it only appears if an older analytics.js tag is still on the page.

How do you read the _ga cookie value?
The _ga cookie keeps its familiar structure:

GA1.1.1162820436.1749482504
| Part | Meaning |
|---|---|
GA1 | Format version. |
1 | Domain level. For example, example.com has a level of 1 and sub.example.com a level of 2. |
1162820436 | Random number that, with the timestamp, identifies the browser (the Client ID). |
1749482504 | Timestamp of when the cookie was created, usually the user's first visit. |
What does the new GS2 session cookie look like?
The _ga_<container-id> session cookie now uses the GS2 format. Instead of values in fixed positions, it uses labelled key-value pairs separated by $:
GS2.1.s1749482503$o1$g1$t1749482510$j53$l0$h1446824558

Google does not publish definitions for each field. The table below shows how the fields are commonly read, based on observed values:
| Part | Meaning |
|---|---|
GS2 | Format version 2. |
1 | Domain level. |
s1749482503 | Session ID, set at the start of the session. The same value is sent as ga_session_id in GA4 hits. |
o1 | Session number (1, 2 and so on), sent as ga_session_number. |
g1 | Engaged session flag (0 or 1). |
t1749482510 | Timestamp of the last hit. |
j53 | Join timer. |
l0 | Login (enhanced user) state. |
h1446824558 | Hashed user ID. |


Why did GA4 change the cookie format?
Because GS2 uses key-value pairs, Google can add, remove or update fields later without breaking the structure. The labels also reduce ambiguity: developers and analysts can tell what each field holds without memorising the position of each value.
Does the new GA4 cookie format affect your tracking?
Not if you use GTM or gtag.js as they are: the tags read and write the cookie for you.
It does matter if you run custom code that parses GA4 cookies directly, for example to read the session ID or session number for the Measurement Protocol or a server-side setup. Code written for the old GS1 positions can return wrong values with GS2, so test it and update the parsing.
Conclusion
The GS2 format is a small change for most sites, but it can quietly break custom integrations that read cookie values. Check any code that parses _ga_<container-id> so your session data stays accurate. If you are not sure whether anything in your setup reads GA4 cookies, a GA4 audit will show it.


