As covered in Find the suitable instrumentation approach, agentless RUM is the appropriate choice for scenarios where:
Once you’ve confirmed these conditions, follow the steps below to set up agentless RUM.
Create a frontend
Choose another RUM JavaScript snippet format
Insert the RUM JavaScript
Keep the RUM JavaScript up-to-date
To create a frontend for agentless RUM
Experience Vitals.The provided RUM JavaScript has the JavaScript tag snippet format. This format is recommended for most scenarios because it ensures automatic updates. With this snippet, the monitoring code loads and executes synchronously.
The New RUM Experience provides several snippet formats to meet different requirements. For details on the available formats and their configurability, see Select a snippet format in the New RUM Experience. For each snippet format, an API endpoint is available.
To get the different snippet formats in the UI
Experience Vitals.Add the RUM JavaScript to the <head> element of every HTML page you want to monitor, and make sure it’s the first executable script on the page.
The example below shows a simple HTML page before and after inserting the RUM JavaScript.
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>MyApp</title><script type="text/javascript" src="myapp.js"></script></head><body><form>Username: <input type="text" name="username"/><br/>Password: <input type="password" name="password"/><br/><input type="submit" value="Login"></form></body></html></html>
For websites that use frameworks or systems with templating, you can usually add custom JavaScript to all pages by placing it in a shared template file—commonly named header.html or similar. These files are typically included automatically in every page during server-side rendering or static site generation. If your site architecture supports centralized templates, use this approach to insert the RUM JavaScript snippet.
When using tag managers, it can be difficult to guarantee that the RUM JavaScript is the first executable script on the page. If you cannot ensure this, you may lose information—such as certain timings or user events—that are only available when both the RUM monitoring code and the configuration are fully loaded and initialized.
This constraint is more pronounced if you configure the script execution option of the JavaScript tag, OneAgent JavaScript tag, or OneAgent JavaScript tag with SRI to async or defer.
If you inserted the RUM JavaScript using the JavaScript tag snippet format, the monitoring code and configuration update automatically. For other snippet formats, you need to update the RUM JavaScript whenever the configuration changes.
The recommended approach is to integrate the snippet insertion into your build process using the RUM manual insertion tags API. This ensures your application consistently runs with the latest configuration.