A user session, also known as a "visit," "journey," or "clickpath," is a sequence of user actions that are performed by the same user in your application during a limited period of time. A single session typically includes multiple page loads, third-party content requests, service requests, and user actions such as button clicks and file downloads. Each user session includes at least one user action.
To view user session data, go to Session segmentation in the Dynatrace menu.
User session identification
Dynatrace typically shows all the sessions of each individual user, even when those sessions are anonymous—non-authenticated users are identified via browser cookies—or when a user tag has been edited or deleted. For mobile apps, Dynatrace identifies individual users based on the specific mobile device they use. For web applications, user identification is achieved by storing a persistent cookie within each user's browser. Cookies enable Dynatrace to assign even anonymous user sessions to known users. As long as a user has logged into your application at least once, you can search for and identify that user, even when the user accesses your application within anonymous, unauthenticated sessions. This is particularly useful for analyzing periods of time when a user may not have been able to log into your application due to an issue with your authentication service.
In Dynatrace, there are two ways to identify a user: through the device identifier or through the user tag. The extended users concept covers use cases where multiple users or user tags share one device. Dynatrace creates segments of the clusters where the same user tags or device identifiers meet in different combinations. You can turn on these segments comprising different combinations when looking at a user on the user detail page.
When you turn on Extended users, all information on the user detail page extends to cover all different combinations of the initial user and the user's relations to other devices and/or user tags.
When you turn off Extended users, information displayed on the user detail page consists exclusively of the data from the specific user tag and the devices used by that user tag. If there's no user tag, then the device identifier is used and only for that particular device. For details on how to configure user tagging, see Identify individual users for session analysis.
User action grouping
Dynatrace stores some information in session cookies and local storage. This enables the correlation of user actions into one user session. This session information is erased however when the browser is closed, the user clears their browser cookies, or the user cleans up their local storage. In such cases, the next initiated user action starts a new user session.
Suppose, for example, that a user performs 10 user actions every 1–2 minutes and after each user action the user either closes their browser or deletes their browser cookies. In such a situation, 10 user sessions would appear on the User sessions page, each composed of a single user action.
Consider another example. A user session is initiated, but after a few minutes the user walks away and leaves their browser window open. After a 45-minute break, the user returns back, and a new user session starts because the browser has been inactive for more than 30 minutes.
User session start, end, and duration
A user session starts when the first user action is initiated.
A user session ends in one of the following ways:
- After 35 minutes of browser inactivity.
- When the user closes their browser.
Note that a user session remains live in the Dynatrace web UI for up to 35 minutes after the user closes their browser.
- Once the limit of 200 user actions per session is reached.
- When the session duration reaches 8 hours.
- By calling the
You can use this function within your application to end user sessions automatically, for example, when the user logs out. You can also use this API call when you want to immediately end a session for testing purposes.
To use this function, open your browser's console and enter
dtrum.endSession(). Your session appears on the User sessions page 2–4 minutes after the end of the session.
- After 10 minutes of inactivity.
Inactivity here means that OneAgent didn't receive any data (for example, because no user actions were performed), not that the app was inactive.
- When the user or the mobile operating system closes or force stops the app.
Note that a user session remains live in the Dynatrace web UI for up to 35 minutes after that.
- When the session duration reaches 6 hours.
- After 35 minutes of inactivity or after the session duration reaches 8 hours—if OneAgent isn't able to end the session for some reason.
- When the session is ended via the Dynatrace API.
Note that a user session does not end when the app is sent to the background, but a session does end if the mobile operating system purges the backgrounded app from memory.
User session duration is the elapsed time between the initiation of the first user action in a session and the completion of the last user action in the session. Note that timeout periods—periods that include no user activity—aren't factored into user session duration measurements.
Typically, a user session appears in the Dynatrace web UI within 4 minutes. However, this could sometimes exceed 10.5 minutes.
Live vs. completed user sessions
Live user sessions are colored light purple and don't have any information about the user experience score or duration as those metrics are calculated at the end of the session. Live sessions can still get new user actions.
Use the Live filter to separate out live user sessions from completed sessions.
Live vs. active users
- A live user is a user who was active once before, but whose session has not yet been ended.
- An active user is a user who has been confirmed still active at a given time.
To make the difference tangible, let's look at an example. A user performs their latest action at 8:00 and is then idle. At 8:15, we would still count this user as a live user because their session has not yet timed out, but we wouldn't count this user as an active user from 8:01 to 8:15.
As a rule of thumb, the number of "live users" sessions should be greater than the number of "active users" sessions because the former can include sessions that started even before the start of the selected time frame and might go beyond the end of the selected timeframe. Or, to put it differently, the former is a count that might span beyond the selected timeframe, while the latter is a point-in-time metric and does not span beyond the selected timeframe. Therefore, comparing these two numbers does not really make sense.
Analysis of a single session across different domains
For technical and security reasons, you cannot analyze a single user session across different domains.
Suppose your user visits two completely different domains during a single "session". How would Dynatrace capture this, given that both domains are instrumented with Dynatrace RUM?
You'd actually see two separate user sessions:
- The first session starts with the page load for the web page of the first domain, and it ends when the user clicks a link that leads them to a web page with a different domain (the second domain).
- The second session starts with the first page load on the second domain, and it ends when any of the criteria for ending a user session is met.
This happens for the following reasons:
- Technical reason: Cookies can't be shared across domains, except for subdomains.
- Security reason: It's a security feature of browsers and a limitation that all vendors share.
- Access live user sessions through the Live user activity tile on the dashboard.
- Go to one of the problem pages to access the related Business impact analysis section.
- Impacted users can also be directly accessed from one of the problem pages.
- Bounces and conversions are available for completed user sessions.