RUM JavaScript API

With the RUM JavaScript API, you can fine-tune Real User Monitoring for your application.

RUM JavaScript API capabilities

The RUM JavaScript API, which is called directly from your application code, offers lots of additional capabilities.

  • Create custom user actions
    If you want to monitor certain functionality of your application that Dynatrace does not capture automatically, you can define your own custom user actions.
    Suppose that you want to monitor a specific UI element that shows up in response to a user click but doesn't trigger a web request. In such a case, Dynatrace will not consider this click to be a user action. With the RUM JavaScript API, you can still monitor such user interactions.

  • Define custom names for user actions
    You can use the RUM JavaScript API to define your own user action names and override the default naming behavior.

  • Report errors
    Sometimes there are errors that Dynatrace cannot recognize by default. You can use the RUM JavaScript API error reporting functionality to send error events, which then show up in the Errors section of the application overview page.

  • Add and extend third-party monitoring
    When the resource timing module is active, all resources from the resource timings are captured. Images and JavaScript files are captured with a third-party module. You can use the RUM JavaScript API to capture additional resources.

  • Add user tags
    With user tags, you can track user behavior of specific users throughout your application environment and across sessions, devices, and browsers.

  • Report properties
    You can use the RUM JavaScript API to report session and user action properties. Note that you first have to define session and user action properties within the RUM application settings. Otherwise, Dynatrace will discard submitted properties.

  • Enable or disable Session Replay
    Using the RUM JavaScript API, you can enable or disable the Session Replay feature.

Customize Real User Monitoring with the RUM JavaScript API

For details on customizing RUM for your application, see the topics listed below.

Note that Dynatrace provides two APIs related to Dynatrace Real User Monitoring:

  • The RUM JavaScript API, which is explained in this topic, is designed to extend out-of-the-box features of Real User Monitoring for your application.
  • The RUM JavaScript REST API is often used to get the most recent RUM JavaScript for agentless RUM. You must then manually insert the RUM JavaScript tag or code into each HTML page of your application. With this API, you can also obtain a list of all manually inserted applications in your environment and verify the most recent version of the RUM JavaScript.