Session calculation

In Google Analytics for Firebase, a session is initiated when an app is opened in the foreground. A session begins to time out when an app is moved to the background, but you have the option to extend that session by logging the extend_session parameter (with a value of 1) on events logged while the app is in the background. This is useful if your app is frequently used in the background, which is common for navigation and music apps.

The default session timeout is 30 minutes, but you can override this by using the setSessionTimeoutDuration method.

Events that are logged during the span of a session are associated with that session in two ways:

  • ga_session_id: a unique session identifier associated with each event that occurs within a session.
  • ga_session_number: a parameter associated with each event that occurs within a session that identifies the ordinal position of a session as it relates to a user, e.g., a user's 1st or 5th session. This is useful for identifying when specific types of events occur, for example: in_app_purchase events occur 85% of the time during the 5th to 7th session.
Was this article helpful?
How can we improve it?