In-depth Understanding Session in Google Analytics 4 | BCS In-depth Understanding Session in Google Analytics 4 | BCSBCS

In-depth Understanding Session in Google Analytics 4

Google Analytics BCS 1 years ago (2023-08-05) 2593 Views 0 Comments

What is Session

The official definition is

a session initiates when a user either opens your app in the foreground or views a page or screen and no session is currently active (e.g. their previous session has timed out).

 

By default, a session ends (times out) after 30 minutes of user inactivity.

 

There is no limit to how long a session can last.

In fact, there are two situations create a session:

  • A session is started when you first visit a page or open an app
  • A return visit after an interval of more than 30 minutes will open a new session (this 30 minutes is the default, which can be adjusted in the session timeout setting of the website)

If the first type is eliminated, because the first visit will definitely generate a session, then there is only one session segmentation mechanism of GA4 – a return visit after an interval of more than 30 minutes will open a new session, which is called “30 minutes of inactivity“.

Session Rules

GA4‘s session count is calculated differently than UA’s: GA4 will only create a new session if the occurrences are more than 30 minutes apart from each other.

The comparison with UA (GA3) is as follows:

GA4 UA(GA3)
30 minutes of inactivity 30 minutes of inactivity
Past midnight
Campaign Changes

GA4 is 30 minutes of inactivity, that is, GA4 will not open a new session until the departure time exceeds 30 minutes.This 30 minutes is adjustable.

With UA, a new session is created after 30 minutes of inactivity, when the time reaches midnight, and when the campaign changes.

Therefore, the number of sessions in GA4 may be lower than the number of general UA sessions

 

 

The Principle of Session

When a session starts, Google automatically collects a session_start event and generates a session ID (ga_session_id) and session number (ga_session_number) via the session_start event.

  • ga_session_idSession ID is a timestamp of when a session began. To analyze different sessions outside of Google Analytics, consider joining the user_id or user_pseudo_id with the session_id to get a unique identifier for each session.(The number of sessions is the timestamp, so it is not unique, so the number of sessions in GA4 is smaller than the actual number)
  • ga_session_numberSession number identifies the number of sessions that a user has started up to the current session (e.g., a user’s third or fifth session on your site).

These information are stored in a cookie named _ga_<container-id>, which is used to maintain the state of the working session, such as:

In-depth Understanding Session in Google Analytics 4

Each part is described as follows:

In-depth Understanding Session in Google Analytics 4

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.

 

Where the trailing 0.0 is not sure what it is.

The validity period of this cookie is 13 months by default. In GA4, you can adjust the validity period through “Override Cookie Settings”, but it is generally not recommended to adjust.

 

 

session_start

As mentioned earlier, GA4 will automatically collect the session_start event when the session starts. In principle, there is only one session_start for one session.

But it will actually appear that a session has multiple session_starts: Some CMP tools will clear the cookie, causing _ga_<container-id> to generate a new value, and session_id will have a new value, so it is regarded as a new session.

In-depth Understanding Session in Google Analytics 4

There is also a session_start of 0, which may be caused by midnight. If the user visits the website on the night of January 1 and leaves directly on January 2, then for January 2, session_start is 0; there may be other reason.

In addition, there is a special case: the session has only one event of session_start, and no other pageview events.

 

How Events Are Associated With Session

Events in GA4 are associated with sessions through ga_session_id, ga_session_number, and requests sent to the GA4 server will have ga_session_id and ga_session_number:

In-depth Understanding Session in Google Analytics 4

 

Both ga_session_id and ga_session_number are obtained from Cookie, more parameters on the request, read more:Explanation of Cookie Values ​​used by Google Analytics 4

 

 

Calculation of the number of Sessions

The official definition of the number of sessions is:

GA4 calculates the number of sessions that occur on your site or app by estimating the number of unique session IDs.

Note that it is an estimate, and the session is an estimate, so there will be GAP, such as:

In-depth Understanding Session in Google Analytics 4

 

The total number of sessions in different dimensions is not equal to the number of sessions in the head, and there will be gaps.

Note:The number of sessions is based on the deduplicated session_id, and the session_id is actually a timestamp, which will be repeated, so the number of sessions in GA4 is low.

 

Metrics Related to Session

The session-related indicators in GA4 are as follows:

  • Engaged sessions:An engaged session is a session that lasts longer than 10 seconds, has a conversion event, or has at least 2 pageviews or screenviews.
  • Engaged sessions per user:The average number of engaged sessions per user.
  • Engagement rate:Engagement rate = engaged sessions / total sessions

If you don't understand, You can leave a comment below.
Like (1)
Post my comment
Cancel comment
Expression Bold Strikethrough Center Italic

Hi, you need to fill in your nickname and email!

  • Nickname (required)
  • Email (required)
  • Website