How do I configure Real User Monitoring for XHR (AJAX)?

Real User Monitoring has a number of helpful settings enabled by default, including W3C timings and third party content detection.

Capture XHR (AJAX) actions

Dynatrace offers support for a number of XHR (AJAX) frameworks, including JQuery, Dojo, Angular.js, and more.

To enable support for XHR (AJAX) frameworks

  1. Go to Settings > Monitoring > Monitoring overview and click the Applications tab.
  2. Select the desired application and click Edit Application > Async requests and single page apps.
  3. In the JavaScript framework support section, select the XHR (AJAX) framework(s) appropriate for your environment.
  • Select Capture fetch() requests to capture user actions data for requests that are based on the Fetch API.
  • Select Support for XmlHttpRequest if your application uses a framework that isn't explicitly supported. This setting uses a generic approach to capturing XHR (AJAX) calls. Enabling this setting means that any interaction that leads to an XmlHttpRequest call will result in an XHR action.
  • Depending on the XHR (AJAX) framework or architecture of your application, you may additionally need to enable the Timed action support setting on the Content capture settings page. This setting is necessary in situations where an application doesn't trigger XHR (AJAX) calls directly in event handlers of HTML elements but rather defers them via SetTimeout calls.
  • You can exclude specific XHR requests from monitoring. For example, if your application sends frequent status-based XHR requests that you don't want to see in your user data. You can exclude such visits to your web site from the local network by adding a network mask for your local network to the list of excluded addresses.

To exclude XHR requests from monitoring

  1. Select Applications from the navigation menu and select the application.
  2. Click the Browse {...] button in the upper-right corner.
  3. Select Edit > Advanced setup.
  4. In the Exclude XHR requests from monitoring section, specify a regular expression that matches the URLs that should be excluded from becoming XHR actions.

You can also customize Real User Monitoring using the JavaScript API.