RUM JavaScript injection

DESK Real User Monitoring (RUM) collects metrics from your customers' web browsers and correlates the browser data with server-side information obtained from OneAgent. Web browser data is collected by a JavaScript tag that is placed inside the HTML of your applications' web pages. We call this JavaScript tag placement an "injection."

How does JavaScript injection work?

You can initiate DESK JavaScript tag injection in one of two ways:

  • OneAgent JavaScript tag injection is performed automatically during installation for Java, Apache HTTP Server, IIS, NGINX, and Node.js. All you need to do to initiate injection is to restart your web server processes after OneAgent installation. OneAgent identifies HTML content responses and automatically injects a small JavaScript tag into the head section of each page.
  • You can alternatively inject the JavaScript tag into HTML code manually without installing OneAgent. We provide the JavaScript tag for you during the set up process. You can paste the tag into the pages you intend to monitor.
    You can define a custom location for tag injection by adjusting application settings. You can, for example, tell DESK to inject the tag before or after a defined string in an HTML response. In the case of Java you can specify injection within the innermost or outermost HttpServletResponse, within a custom servlet, or within a filter.

To access custom injection settings

  1. Click Applications from the navigation menu.
  2. Select the application you want to configure.
  3. Click the browse button (...) and select Edit.
  4. Click Advanced setup.
  5. Click JavaScript injection on the right hand-side.

Depending on how you enable RUM, monitoring data is sent to DESK within varying request types:

  • If you have OneAgent installed:
    Our JavaScript sends data back to your web server (Java, Apache, IIS). OneAgent performs some initial monitoring of the data and then forwards it to DESK server. Transmission of data is performed using XHR Post requests.
  • If you don't have OneAgent installed:
    Data is sent directly to DESK, bypassing your infrastructure.

Where is the JavaScript tag injected?

The DESK JavaScript only works with valid HTML. Messy page code is often the culprit when monitoring-data flow breaks down. So pay special attention to basic HTML best practices (i.e., no unclosed or missing tags).

Our JavaScript tag is injected only into HTML. We don't modify images, CSS, REST services, or XML files. OneAgent always tries to inject the JavaScript tag as the first script on the page. This helps to keep your application intact but also guarantees more reliable monitoring results (for example, timing). If you inject the JavaScript tag manually, ensure that it's the first executable script on each page.

The following rules specify the criteria for determining a suitable location within an HTML document to inject the JavaScript tag.

If OneAgent doesn't automatically inject the JavaScript tag because of HTML validation errors, you can add a custom monitoring rule. For information about accessing custom injection settings, see the instructions detailed above.

Not sure that Real User Monitoring is working in your environment? Having trouble with your setup? Have a look at Why don't I see my applications or monitoring data?

What about older internet browsers?

For an older internet browsers (Internet Explorer and legacy versions other browsers) interacting with massive DOMs and Visually Complete metric enabled, we recommend to use additional parameter vcfi=0 (Application settings - Capturing - Advanced setup - Custom configuration properties), which provide carefully handling of images.