Understanding Sessions and the session_start Event in Google Analytics 4
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 is logged when a user opens your app in the visible area of the device screen or views a page/screen, and there are no currently active sessions — for example, when the previous one has timed out.
By default, a session ends after 30 minutes of user inactivity — even if the browser tab remains open, the session is terminated. If the user is actively engaging with your page or screen, the duration is not limited. The 30-minute timeout is the standard setting, but it can be changed in the admin panel. This is useful when your site involves longer interactions without frequent activity — for instance, if your site is a workspace interface where a user may return to the same page after an hour without regular interactions.
How Events Relate to Session ID and Session Number
When a session starts, Google automatically collects the session_start event and generates both the session ID (ga_session_id) and the session number (ga_session_number).
The session ID is generated automatically as a timestamp in seconds at the moment the session begins. To analyze sessions outside Google Analytics, you can combine user_id or user_pseudo_id with the session_id to obtain a unique identifier for each session.
The session number indicates how many sessions the user has started before the current one — for example, their third or fifth visit to your site. This means that if a user has visited your site five times, or allowed five sessions to expire through inactivity and restart, each session will be numbered sequentially and assigned its own unique ID.
How Sessions Link with Other Events
The session ID and session number are automatically tied to every event in the session via gtag.js and the Google Analytics for Firebase SDK. This means that any page_view, form_submit, or other event will inherit the session ID and number associated with that session. As a result, the interaction chain is linked back to the session. However, session IDs are not automatically included in events sent via Measurement Protocol or Data Import.
In some cases, the session ID may not be linked with the session_start event — for example, if the event is filtered out of a subproperty. Even then, Analytics still generates a session ID.
How the Number of Sessions Is Calculated
Analytics calculates the number of sessions on your site or in your app by counting unique session IDs.
Session Start and First Visit
The session_start event is an automatically collected event. It requires no setup and is logged by default along with events such as page_view, user_engagement, and first_visit.
Alongside session_start, the first_visit event can also be triggered if Google Analytics does not recognize the user based on existing cookies. At the same time, a new user is created.
The first_visit and session_start events are distinct: one records a new user (a new cookie — new browser or device), while the other records any session regardless of user type.
In practice, session_start occurs every time someone visits your site, even if they have been there before, while first_visit happens only once per cookie.
Session_start and User Engagement
The user_engagement event is logged during a session in which the user spends more than 10 seconds on the site, views more than two pages, or completes a conversion. This event is tied to the session and to the ga_session_id parameter.