Dimensions and metrics

[GA4] About Analytics sessions

Discover more about Google Analytics 4 sessions including how session IDs and numbers are generated when events are started.

A session is a period of time during which a user interacts with your website or app.

What counts as a session

In Analytics, 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, for example, their previous session has timed out.

By default, a session ends or times out after 30 minutes of user inactivity. There is no limit to how long a session can last.

Adjust session timeout

Adjust app session timeout

An app session begins to time out when an app is moved to the background, but you have the option to extend that session by including an extend_session parameter (with a value of 1) with events you send while the app is in the background. This is useful if your app is frequently used in the background, for example, as with navigation and music apps.

Change the default timeout of 30 minutes for app sessions via the setSessionTimeoutDuration method.

Adjust web session timeout

To change the default timeout of 30 minutes for web sessions:

  1. In the Property column, click Data Streams.
  2. Select a web data stream.
  3. At the bottom of the page, click Configure tag settings.
  4. In the Settings section, click Show all to see all available options.
  5. Click Adjust session timeout.
    • Adjust session timeout: set the session timeout in hours and minutes.
    • Adjust timer for engaged sessions: select the number of seconds it takes for a session to be considered an engaged session.
  6. Click Save.

How events are associated with a session ID and number

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.

  • Session 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.
  • Session number identifies the number of sessions that a user has started up to the current session, for example, a user's third or fifth session on your site.

Both the session ID and session number are associated with each event in a session automatically via gtag.js and the Google Analytics for Firebase SDK. However, the identifier is not included automatically in events from Measurement Protocol or Data Import.

Sometimes the session ID isn't associated with the session_start event, for example, when the event is filtered out from a subproperty. In these cases, Analytics still generates a session ID.

How the number of sessions is calculated

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

How session attribution works

The session_start event carries the information that determines the attribution of the session, such as the gclid, UTM parameters, and referrer.

The attribution model for sessions stays the non-direct last click attribution model, and the conversion window is determined by the "All other conversion events" setting, which is 90 days by default. Learn more about selecting or updating attribution settings.


Default 90-day conversion window

Day 1: The user arrives on the website through a Google organic link => session is attributed to “google / organic”
Day 68: The user comes back to the website directly => session is also attributed to “google / organic”

Where you can view session metrics

Session and User metrics are calculated through an estimation. Google Analytics provides a number of session metrics, including Session, Engaged sessions, and Engaged sessions per user. These metrics allow you to view data about the number of sessions that have started on your site or app.

The metrics appear in reports, such as Acquisition overview, User acquisition, and Engagement overview. You can also view session metrics in Explorations.

Differences in session counts

As of October 2021, Google Analytics began updating the calculation method for session metrics in your standard and custom reports and in Explorations and Looker Studio to more efficiently count sessions with high accuracy and low error rate. As a result, you may notice a small difference in session counts from the previous calculation method.

This new calculation method is applied to session data back through October 2021. Analytics won't display data if the date range for your report includes data from before October 2021. However, you can still access historical data in your event report by filtering for event=session_start.

BigQuery considerations

In addition to being able to view session counts in Google Analytics, you can export your data to BigQuery so you can query your session counts through a SQL-like syntax. BigQuery has enough time and resources to calculate the precise number of sessions and therefore doesn't apply the efficient calculation method called the HyperLogLog++ algorithm for session metrics. Learn more about Unique count approximation in Google Analytics

Because BigQuery doesn't apply the more efficient calculation method, you may notice small differences in session counts when comparing the results to those in your standard and custom reports and in Explorations and Looker Studio.

When choosing where to look at your data, consider the following:

  • When you want more precise results from your raw data, view the results in BigQuery.
  • When you want more efficient results, view the results in your standard and custom reports and in Explorations and Looker Studio.

For most of your queries, the results from the new calculation method enable you to effectively compare session metrics over time.

When you look at session counts from last week, you notice 1,463 sessions in your reports and 1,501 sessions in BigQuery. When you look at session counts in the current week, you notice 1,828 sessions in your reports and 1,876 sessions in BigQuery. While the specific counts slightly vary, you will notice a 25% increase in the number of sessions. In other words, you can use the same data to observe the directional change in session counts.
Source Last week (sessions) This week (sessions)
Reports 1,463 1,828 (+25%)
BigQuery 1,501 1,876 (+25%)

Was this helpful?

How can we improve it?
Clear search
Close search
Google apps
Main menu