Managing Sessions

In Journey Analytics, a session starts when a user accesses your website/app and ends after that user has not performed any event for a specified amount of time.

Sessions table

Journey Analytics maintains an aggregated table of session information called the Session Table. This is the source from which Journey Analytics extracts behavioral analytics, meaning analysis and reporting of the sequence of user events. For example, in Funnel and Cohort reports. Some reports extract data from this Session Table instead of from the Events Table. Extraction from the Session Table is faster than from the Events Table. However, the Session Table does not maintain information about the properties of an event.

Session ID

Journey Analytics automatically assigns a unique identifier (Session ID) to each session.

You can specify your own session ID by including the session_id property in the event sent to Journey Analytics. If you send your own session ID, then this information is stored as a property called customer_session_ID. Journey Analytics still maintains its own Journey Analytics session ID in addition. You can then query using either customer_session_ID or Journey Analytics's session_ID.

Note: Properties that are calculated per session are based on Journey Analytics's session ID (session_id), and not on your session ID (customer_session_ID).

Session properties

Some Journey Analytics properties are collected per session:

  • session_duration – The duration of the session, in milliseconds.
  • session_path – A session path is a sequence of event names (funnel) in a session. Journey Analytics provides various visualization options showing the path of events in a user session, such as a Funnel report, Cohort report or Path report.
  • session_id – A unique ID assigned to a specific user for the duration of that user's visit (session).

Ending a Session

Journey Analytics automatically stores the events of a session when it ends. Therefore, it is important to ensure that a session ends.

Journey Analytics automatically ends a session after no events have been sent for that user for a specified amount of time – by default, 30 minutes. This can be changed from the Project – Settings page.

If a session does not end within six hours, then Journey Analytics automatically ends it and stores its data. Therefore, if a session is still getting events, then it may take a while until you are able to query that data.

Best Practices:

  • For a website session, we recommend a timeout of 30 minutes.
  • For an app session, we recommend a timeout of 5 minutes.
  • If your website has videos that include advertisements: if ads are sent as events we recommend using the 30-minute timeout. However, if the ads are not sent as events, we recommend you lengthen the session timeout to longer than the video, which might run more than an hour before sending an event.

Include in Path

Each event that you define in Journey Analytics has an Include in Path setting that specifies whether an event is shown in the Journey Analytics behavior analytics visualizations (Funnel, Cohort and Path Analysis reports) or not. The Include in Path field should be off for certain types of repetitive events that are not needed for a session analysis.

For example, a keep_alive event that is generated when the device periodically verifies that it is still connected. Because keep_alive and page_load events are sent repeatedly, the session will only end after six hours unless you turn the Include in Path option off because Journey Analytics will continue to leave the session active for 30 minutes (default) after each event.

Regardless of the value selected in the Include in Path field (meaning even if it is off), the event still affects the session_duration (which is the duration of the session, in milliseconds) and is still counted in the session_event_counter (which is the number of events in the session).