This article will help you:
|
The User Sessions chart helps analyze your users through various session-based metrics. By showing you the distribution of session lengths, average session length, and average sessions per user, it can help you answer questions like:
- How frequently are users engaging with your product?
- How long are they engaging with your product?
- How do these metrics compare to other segments of users?
Before you begin
First and foremost, events will not appear in any Amplitude charts until instrumentation is complete, so make sure you've got that done. You'll definitely want to read our article on building charts in Amplitude, as this is where you'll learn the basics of Amplitude's user interface. You should also familiarize yourself with our helpful list of Amplitude definitions.
You may also want to read up on session IDs and how Amplitude tracks sessions.
Set up a User Sessions chart
Most Amplitude charts rely on the Events Module to build an analysis. The User Sessions chart is not an event-driven analysis—and, therefore, does not have an Events Module—so it works a little differently.
Instead of events, a user sessions analysis will break out your users into groups based on certain characteristics of their sessions spent using your product:
- Session Length Distribution: This chart displays the distribution of session lengths in a histogram. The example above shows session length distribution for all users, grouped by country, daily, for the last seven days.
- Average Session Length: This chart graphs the average session length, which is calculated by taking the sum of all session lengths within the interval, and dividing it by the total number of sessions in that interval.
Here, we see that the average session length varies somewhat depending on each user's device type. - Average Sessions Per User: Graphs the average number of sessions per user, which is calculated by taking the total number of valid session IDs within the interval, and dividing it by the total number of active users with valid a valid session ID. (In this case, "valid" means a session with an ID other than 'none' or '-1.')
Here, we see that the average number of sessions per user, per day, is steady for all the countries where your product's users can be found.
Build a User Sessions chart
To build your own user sessions chart, follow these steps:
- In the Sessions Module (where you'd ordinarily find an Events Module), select the sessions-based metric you're interested in.
- In the Segmentation Module, identify the user segment you want to include in this analysis. You can import a previously-saved segment by clicking Saved Segments and selecting the one you want from the list. Otherwise, Amplitude begins from the assumption that your analysis will target all users.
- If you do not want to import a previously-saved user segment, you can start building your own by adding properties. To do so, click + where, choose the property you want to include, and specify the property value you’re interested in.
- You can narrow your focus even further by telling Amplitude you only want to include users who have already performed certain actions. To do so, click + perform, then choose the event you’re interested in.
- If desired, add another user segment by clicking + Add Segment, and repeating steps 3 and 4.
- Use the date picker to set the timeframe of your analysis.
The three ways Amplitude records sessions
Amplitude records sessions on either the server side or the client side. Additionally, client side sessions can be either mobile or web.
- Server side: You can use the HTTP API v2 to track sessions on the server side by including a value in the session_id field. The session_id value will be the number of milliseconds since epoch, counting from the start of the session.
- Client side (mobile): When using Amplitude's mobile SDKs, events triggered within 5 minutes of each other are, by default, counted towards the current session. 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, Amplitude will count events sent within five minutes of each other towards the current session.
- Client side (web): When using Amplitude's JavaScript SDK, events triggered within 30 minutes of each other are, by default, counted towards the current session. 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.
NOTE: The User Sessions chart will only display data if you are sending a session ID with your events. Amplitude's SDKs will handle this for you automatically, unless you flag an event as out-of-session (assigning the session ID a value of '-1'). However, if you're using Amplitude's HTTP API, you'll have to explicitly send a session_id with your events.
The data table
Underneath the chart is a table of sessions data. You can specify which segments you see in the graph by clicking on a segment name in the data table. You can download the table by clicking Export CSV.