What are user actions?

User action types

A “user action” is comprised of all client activity that occurs during the transition from one application state to another. Each user action contains at least one web request. For example, when a user navigates to a page, the browser may download multiple resources and call a JavaScript onload handler, which in turn might perform some XHR requests. All this activity is considered part of the same user action.  

The duration of a user action is called the ”action duration”. This represents the amount of time that the user waits until it’s possible for them to continue. This means that a low action duration (i.e., response time) is better than a high action duration.

There are different kinds of user actions:

Initial page load

A page load is represented as a single user action, such as a user entering a URL into a browser’s address bar. The start time of the user action begins with the W3C navigationStart time, if available. If not available, the start time begins when the JavaScript agent is initialized in the browser. The end time is when the last onload handler has completed its task. If any XMLHttpRequests are started by an onload handler, the user action ends when the XMLHttpRequest is complete.

Web 2.0 actions and XHR calls

In Web 2.0 applications, when a user interacts with a web site, some actions may cause an incomplete page reload. For example, a user might click a Search button that triggers an XMLHttpRequest and alters the DOM tree of the current page. Each JavaScript execution with at least one XHR is represented as a user action. JavaScript executions without an associated XMLHttpRequest  are pure client-side actions and don’t count as user actions. The start time of the user action is the time of the event. The end time is the end of the last onreadystatechange event that is triggered by the XMLHttpRequest. If an XMLHttpRequest  triggers additional XMLHttpRequests, they are considered to be part of the same user action.

Custom user actions

Rather than relying on default user action generation, you may want to fine-tune your real user monitoring by adding additional user actions directly into your application’s HTML. This can be useful if our automated user-action generation doesn’t catch specific actions or you want to introduce specific fine-grained timings into your application monitoring. For example you could measure how long it takes to open a JavaScript-only drop-down menu, or measure the duration time of some JavaScript code.

To download the JavaScript API samples and instructions, go to Settings > Web monitoring > Custom user actions.

User action naming rules

Many applications allow users to accomplish the same goal through different UI controls. When monitoring such applications it can be difficult to differentiate between actions that are slightly different though essentially the same. Likewise, if the UI of a application is translated into multiple languages, the same application function or control may appear under varying names. With user action naming rules, Dynatrace can detect such subtle variations and intelligently group related user actions into logical groups for monitoring.  

Note: Dynatrace automatically removes certain common sessionid tokens from user action names (for example, jsessionid for Java containers, the default sessionid for PHP, and CFID and CFTOKEN for ColdFusion). Nonetheless, there are numerous session ID variations that may be present in your environment. If Dynatrace doesn’t automatically recognize and remove session IDs from certain user action names you encounter, you’ll need to configure custom naming rules for those user actions.

To configure naming rules for user actions, go to Settings > Monitoring overview > Applications and select your application. Then go to User actions to configure settings related to user action and URL detection.