A user session, sometimes known as a "visit," is a group of user actions that are performed in your web application during a limited period of time. A single session typically includes multiple page loads, 3rd-party content requests, service requests, and user actions (for example, button clicks and file downloads). Each user session includes at least one user action.
Live user sessions are differentiated from ended user sessions by color, thereby allowing you to spot active sessions at a glance.
To view user session data, select User sessions from the navigation menu.
Dynatrace typically shows all the sessions of each individual user, even when those sessions are anonymous (non-authenticated users 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.
When does a user session start?
A user session starts when the first user action is initiated.
When does a user session end?
A user session ends in one of the following ways:
- After 30 minutes of browser inactivity.
- When the user closes their browser. Note that the session only ends when the browser is closed and remains live in the UI until 30 minutes of inactivity.
- Once the limit of 200 user actions per session is reached.
dtrum.endSession(). This function can be used within your application to end user sessions automatically when, for example, the user logs out. You can also use this API call if, during testing for example, you want to immediately end browser sessions. To use this function, open your browser's console and enter the call
dtrum.endSession(). Your user session will then appear in the User sessions view 2-4 minutes after the end of the session.
How long does it take for a user session to be visible in the user session search?
Typically, a user session is visible in the search within 4 minutes. However, this could sometimes exceed to 10.5 minutes.
How are user actions grouped into user sessions?
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 (1) the browser is closed, (2) the user clears their browser cookies, or (3) 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 in User sessions view, each comprised 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. If the user were to close their browser before taking their break, a new user session will start when the user returns to the application, regardless of how long they were away from their computer.
How is user session duration calculated?
User session duration is the elapsed time between initiation of the first user action in a session and the completion of the last user action in the session.
Note: Timeout periods (which include no user activity) aren't factored into user session duration measurements.
How to differentiate live user sessions from completed sessions
Live user sessions are colored light purple and the arrow head at the end of the timeline indicates that new user actions can be added to the session. For complete user sessions, there is no arrow head.
The Live filter can be used to separate out live user sessions from completed sessions.
Can you analyze a single web session across different domains?
No, for technical and security reasons.
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 you click a link that leads you 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.
Why this happens:
- Technical: cookies can't be shared across domains (except for subdomains)
- Security: it's a security feature of browsers and a limitation that all vendors share
- Live user sessions are directly accessible through the Live user activity tile on the dashboard.
- Problem pages can be clicked to easily access the related Business impact analysis.
- Impacted users can also be directly accessed from the problem pages.
- Bounces and conversions are available for completed user sessions.