GA4 will generate two cookies to distinguish users and sessions:
Cookie name | Default expiration time | Description |
---|---|---|
_ga | 2 years | Used to distinguish users. |
_ga_<container-id> | 2 years | Used to persist session state. |
Although the default validity period of these two cookies is 2 years, due to some browser restrictions on first-party cookies, the maximum validity period is 400 days, so in fact, the validity period is about 13 months.
Next, let me introduce the specific information in these two cookies, take bbccss.com as an example:
_ga
The detailed explanation is as follows:
Value | Description |
---|---|
GA1 | Version number, which represents the version of the cookie format that’s being used. |
1 | Domain Level,e.g. haranhang.com = 1, haranhuang.co.jp = 2, number of dots |
1197596843 | Random Number, 10 digits |
1673515099 | Timestamp, the timestamp when cookie _ga was created |
1197596843.1673515099 composed of 1197596843 and 1673515099 is what we usually call Client ID.
_ga_<container-id>
The detailed explanation is as follows:
Value | Description |
---|---|
GS1 | Fixed String: Google Stream 1 |
1 | Domain Level,e.g. haranhang.com = 1, haranhuang.co.jp = 2, you can count number of dots |
1673933110 | Session ID/Current Session Start Time |
12 | Sessions Count |
0 | Engagement Session, 1 means engagement session, 0 means no |
1673933110 | Current Timestamp |
60 | Countdown,60-second countdown may be used to calculate the Engagement Session or the time spent on the page. |
0 | to be determined |
0 | to be determined |
For the first request of the session, the Session ID and Current Timestamp are the same, because the Session ID is the Current Session Start Time
Referral: