What counts as a session
A session initiates when a user either:
- Opens your app in the foreground
- 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.
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, (e.g. as with navigation and music apps.)
Change the default timeout of 30 minutes for app sessions via the
Adjust web session timeout
Change the default timeout of 30 minutes for web sessions as follows:
- In Admin, navigate to the property whose web sessions you want to configure.
- Click Data Streams and select your web data stream.
- Under Additional Settings, click More Tagging Settings, then 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.
- Click Save.
How events are associated with a session
When a session starts, Google automatically generates a session ID (
ga_session_id) and session number (
ga_session_number) via the session_start event.
- Session ID identifies the session that an event came from. For example, two different session IDs are generated when a user has two separate sessions on your site.
- Session 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).
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 is not associated with the
session_start event (e.g., 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 to see session metrics
Google Analytics provides a number of session metrics, including Session, Engaged sessions, and Engaged sessions per user. These metrics allow you to see 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 see session metrics in Explorations.
Differences in session counts
As of October 2021, Google Analytics began updating the calculation for session metrics to more efficiently count sessions with high accuracy and low error rate (typically less than 2%). As a result, you may notice a small difference in session counts from the previous calculation method. The new metrics are available in your standard and custom reports and in Explorations.
Differences from Universal Analytics
The session counts in your Google Analytics 4 property may be lower than the session counts in your Universal Analytics property. This is because Google Analytics 4 does not create a new session when the campaign source changes mid session, while Universal Analytics does create a new session under that circumstance.
If a session crosses a day boundary (e.g. if it starts at 11:55 pm and ends at 12:05 am), it is considered a single session, though it is counted once for each day. Learn more about the session differences