The User Sessions chart helps analyze your users through various session-based metrics. It allows you to see the distribution of session lengths, average session length and average sessions per user.
What you will learn in this article
This article goes into detail regarding the following topics:
- What are the three user session metrics
- Session ID property vs Custom Session property
- Chart control and interpretation
- Breakdown Data Table interpretation
Before reading this article, we recommend understanding how sessions are recorded in the following three ways:
- Server-side: Sessions can be tracked server-side using the HTTP API V2 by including a value in the session_id field. The session_id is the number of milliseconds since epoch, counting from the start of the session.
- Client-side (mobile): By default, using our mobile SDKs, events triggered within 5 minutes of each other are counted towards the current session (the same Session ID). The time of the first event marks the start time of a session and the last event triggered marks the end time of a session. For example, the first event could be marked by an 'Open App' event. In addition, events that are sent within five minutes of each other are counted towards the current session (the same Session ID).
Other things to keep in mind about these features:
- You will not see any data in this chart if you are not sending a Session ID with your events. Our SDKs will track this automatically for you unless you flag an event as out-of-session (Session ID = -1) but if you are using our HTTP API, then you will have to send a session_id with your events.
User Sessions Metrics
User Sessions displays one of three charts: a distribution of session length, the average length of a session, or the average number of sessions per user. Use the "Show" dropdown menu in the left panel of the chart control panel to select the particular chart.
The metrics you can measure are:
- Session Length Distribution: Shows the distribution of session lengths in a histogram.
- Average Session Length: Graphs the average session length, which is calculated by the sum of all session lengths within the interval divided by the total number of sessions in that interval.
- Average Sessions Per User: Graphs the average number of sessions per user, which is calculated by the total number of valid* session IDs within the interval divided by the total number of active users with valid a valid session ID
*valid = (Session ID ≠ -1 or (none))
Session ID property vs Custom Session property
If the Amplitude Session ID property is selected as Session Property, Session ID treated as the timestamp of the start of the session. Sessions with Session ID = -1 (or any negative session id) are ignored.
If there is a Custom Session Property selected, the custom Session property is used only for grouping, not in session length computation. Events that don’t have a value for the selected session property are ignored.
Chart Control Panel
The left module is used to select the particular session metric you want to see in your chart.
Use the right module in the control panel to create and analyze segments of users based on their properties or actions performed. You can read more about how to compare user segments here.
You can set up and interpret any User Sessions chart easily as the UI allows you to read the parameters like a sentence. For example, the following chart shows you the average session length (1), for all your users(2), grouped by country (3), daily for the last seven days (4).
Average Session Per Day
The chart below shows the output for the Average Sessions Per Day Per User with grouped by excluded.
Average Length Per Session
The chart below provides a view of the distribution of the average length of time users are spending in the application per session.
You can use the date picker to choose a more specific time range to analyze your data and can switch between "Last", "Between", and "Since".
Additionally, you have the option to view data in daily, weekly, or monthly units by toggling between the different options in the dropdown menu next to the date picker. If you are looking at multiple segments in your chart, you can manually select and deselect each segment by hovering over the segment name in the bar below the chart and removing it or by clicking the "+" button to add it back. Finally, you can click on any data point in the chart to inspect the users that make up that data point by using Microscope.
Breakdown Data Table
Underneath the chart is a data table of sessions data for the Average Session Length chart. The below image is an example data table of the average session length per day segmented with the "+Group By" function. You can select or deselect which segments you see in the graph by clicking on the segment name in the data table. Furthermore, the data table can display some simple calculations for you.
- Row Average: takes the average of all the data points in the chart.
- Row Median: takes the median of all the data points in the chart.
- Row Sum: takes the sum of all the data points in the chart.
- Row Change: takes the difference between the first and last data points in the chart.
Lastly, you can download the data table by clicking the "Export CSV" button.