Set up agentless Real User Monitoring

Agentless monitoring is designed to be used when you don't have access to your web server and therefore can't install OneAgent. However, before deciding on a third-party library, note that the full benefits of Real User Monitoring can be obtained only after you’ve installed Dynatrace OneAgent.

For some technologies, RUM JavaScript automatic injection is not supported even when you can install OneAgent. For example, while OneAgent can monitor the server side of a Heroku application, it cannot inject the RUM JavaScript into the application's pages. If that's the case, you need to manually add the RUM JavaScript to your application's pages.

For a list of technologies and servers that support RUM JavaScript automatic injection, see Technology support - Real User Monitoring auto-injection.

The installation of Dynatrace OneAgent is highly recommended for the following reasons:

  • With agentless monitoring, you need to manually insert the RUM JavaScript into each of your application’s pages, which can be challenging. Dynatrace OneAgent handles the insertion of the RUM JavaScript for you.
  • Unless you use the code snippet or JavaScript tag insertion option for agentless monitoring, the RUM JavaScript embedded into your application’s pages won't be automatically updated when you change application monitoring settings. You’ll have to update the code manually.

Performance impact

To minimize the impact on page-load time and your users’ first impressions of your application, you might want to load scripts as late as possible. Use blocking script tags to ensure that your RUM JavaScript will be executed exactly where you place it. If you need a script to run as early as possible, the execution can’t be postponed. One way to avoid these additional blocking requests during page load is to inline the script code. The script code needs to be inlined into each document, thereby propagating the data of a single cached file into every page of your application. By combining both these approaches, you can get an inline JavaScript snippet that performs the required initialization and defers loading of the big bulk of the code to a second script.

Standards and security policies

Certain development standards that are created to make applications more secure and faster also introduce new limitations. For example, the Content Security Policy (CSP) standard was introduced to minimize the chance of becoming a victim of cross-site scripting, thereby disallowing inline JavaScript code. This means that you have to use a simple JavaScript tag to inject the RUM JavaScript.

Another standard, the AMP project, aims to provide a framework that helps you build applications that are consistently fast across all devices and system platforms. In this case, self-developed and third-party JavaScript code isn't allowed; only scripts provided by AMP can be used.

To monitor AMP applications with Dynatrace

  1. In the Dynatrace menu, go to Deploy Dynatrace.
  2. Select Setup agentless or AMP monitoring.
  3. Turn on My application relies on Accelerated Mobile Pages (AMP).

AMP application monitoring

Maintenance effort

Agentless monitoring requires you to insert tags by yourself, which is why you must ensure that it requires as little manual effort as possible. You don’t want to have to change your code every time your configuration changes or when a new version is released. The code snippet added to your application usually doesn't need to be changed as it takes care of loading the right configuration and version for you.

Insertion methods

The RUM JavaScript insertion format depends on the application and your requirements. Find out about the available options for the RUM JavaScript insertion.

To choose an agentless Real User Monitoring insertion approach

  1. In the Dynatrace menu, go to Web.
  2. Choose the application that you want to configure.
  3. Select Browse () > Edit.
  4. From Application settings, select Setup.
  5. From the Insert monitoring code drop-down list, select an insertion method.

Insertion options


Dynatrace offers a REST API that allows you to automatically retrieve the latest RUM JavaScript for your application. You can automatically inject the latest code or tag during the build time of your application. To learn how to use the API, see Real User Monitoring JavaScript API.

You can also retrieve URL to download the RUM JavaScript as HTML tag in Dynatrace.

  1. In the Dynatrace menu, go to Web.
  2. Select the application that you want to configure.
  3. Select Browse () > Edit.
  4. From Application settings, select Setup.
  5. In the REST API section, select your API token. See Dynatrace API - Authentication to learn how to obtain it.
  6. Select Copy to retrieve the download URL.


Here's what you'll need to set up agentless Real User Monitoring:

  • RUM JavaScript—a custom JavaScript code or tag generated by Dynatrace
  • Access to your application’s HTML source so that you can insert the RUM JavaScript
  • (Managed deployments only) A CDN to serve the RUM JavaScript that will prevent web page performance problems during Dynatrace Managed Server maintenance periods or local network outages

Set up agentless monitoring