This page describes configuration and hosting options for the JavaScript Agent. 

Configure the JavaScript Agent

To configure the JavaScript Agent in the Controller:

  1. Go to a browser application. 
  2. In the left-hand panel, go to Configuration Configure the JavaScript Agent
  3. Select a hosting option.

  4. Customize the code snippet in Step 2: Advanced settings (Optional)

  5. Click Save.

Advanced Configurations

This table describes advanced configurations for the JavaScript Agent snippet. You can add these advanced configurations manually or using Controller >= 20.7.0. When you check a box in the UI, such as Use HTTPS by default, the JavaScript snippet automatically updates to reflect the selection, such as config.useHTTPSAlways = true added to the UI snippet.

Available in SaaS Controller >= 20.7.0Manual Configuration InstructionsSummary

Use HTTPS by defaultUse HTTPS as the default transport protocol for the JavaScript Agent. If unchecked, the agent chooses the transport protocol used to load the base page.

Set cookie to strict domainLimit the cookie to the full strict domain name. If unchecked, the cookie is set to the broadest version of the originating domain (such as, *

Set GeoServer URL

If your application uses internet IP addresses or users connect through a VPN, enter your custom GeoServer URL to map internal IP addresses to physical locations. If unchecked, end-user locations are resolved using the default GeoServer.

Configure Resource URL SegmentsSet the maximum number of segments and characters in resource URLs to view more or less of a URL in the Controller UI.

Hide URL query stringBy default, URL query strings may be long or contain sensitive information. Check this box to hide the full string from the Controller UI.

Cross-domain session correlationEnable sessions to continue across subdomains. If unchecked, sessions are restricted to one domain and navigating from one domain to another will end the session.

Configure request origin locationSet a specific IP address or location as the origin of the request. You can specify only the IP address, or the complete location (IP, country, region, and city).

Configure resource optionsConfigure which resources are monitored based on how they are ordered, the maximum number of resources that will be evaluated, and whether the resource timing buffer should be cleared when it's full.

Modify resource sampling optionsModify how the resources are ordered (using the sampling algorithm) and the maximum number of resources to be evaluate.

Capture page titleCapture the page title as part of the beacon, displayed in Browser Snapshots. Uncheck this setting to hide the page title for security or privacy reasons. Check this setting to set a custom page title with an arbitrary URL string.

Enable SPA2 monitoringMonitor single-page applications (SPAs) to detect virtual pages and correlate resources, JavaScript errors, and AJAX requests.

Enable resource timing buffer clearing for SPAsFor SPAs, the JavaScript Agent by default clears the resource timing buffer after it is full and saves the data in a local buffer. You can configure the JavaScript Agent so that the resource timing buffer is not cleared to capture resource timing data. 

Set the custom page nameThe page name is used to identify and group pages in Pages & AJAX Requests. If unchecked, the default page name consists of the hostname, port, and path.

Filter virtual pagesConfigure rules to exclude specific virtual pages from being monitored.

Monitor Fetch API callsBy default, the JavaScript Agent monitors Fetch API calls for all SPAs except applications using Zone libraries, including Angular applications. Only consider disabling this setting for specific use cases.

Set AJAX request limitTo prevent an overload of AJAX requests, you can limit the number of requests sent per base and virtual pageview. The limit is 250 requests for single-page applications (SPAs) and 50 requests for non-SPAs.

Filter XHR calls by URLInclude or exclude specific XHR calls to be monitored.

Report events with the JavaScript APIThe JavaScript API enables you to manually report events to the agent so that it can time the various parts of your virtual page loads and correlate Ajax calls to those page loads. You can also capture and report errors with this API.

Limit beacon typesBy default, sending image beacons is disabled and beacons are only sent with Cross-Origin Resource Sharing (CORS). If you have an older browser that does not support CORS beacons, you can enable sending image beacons.

Disable browser monitoring programmaticallyFor pages in which the JavaScript Agent was injected manually, you can disable the agent programmatically by adding a script to the header.

Handle the window.onerror eventIf any script on your monitored web pages or library code sets the JavaScript window.onerror event, add the method ADRUM.listenForErrors()to the page immediately after setting window.onerror.

Set Ajax request names based on captured POST parametersYou can configure the JavaScript Agent to capture POST parameters and then use the parameter(s) to name the Ajax request in Pages & Ajax Requests. This configuration enables you to identify and sort Ajax requests from the same page based on POST parameter(s).

Set custom virtual page namesYou can configure the JavaScript Agent to use any arbitrary string (that is not necessarily a part of the URL) to name a virtual page.

Add custom user data to a page browser snapshotYou can add user information that is specific to your application to a browser snapshot. The information is expressed as key-value pairs that are attached the JavaScript Agent configuration and later included in the beacons sent to the EUM Server.

Disable the primary metricYou can disable the primary metric to help improve application performance. 

Configure Shared-Hosting 

If you are using shared-hosting and do not want to use the default CDN, follow these instructions to provide your own CDN for only hosting the main JavaScript Agent file (adrum-[version].js):

  1. From Controller Admin, go to Controller Settings.
  2. For the values of settings and, enter the URLs where the JavaScript Agent files are being hosted.
  3. Confirm these URLs match the URLs in the JavaScript snippet you want to inject.

Configure Self-Hosting 

If you are self-hosting and do not want to use the default CDN, follow these instructions to provide your own CDN for hosting all of the JavaScript Agent files:

  1. From the Controller Admin, go to Controller Settings.
  2. For the values of settings and, enter the URLs where the JavaScript Agent files are being hosted.
  3. Confirm these URLs match the URLs in the JavaScript snippet you want to inject.

Next Steps

After you configure the JavaScript Agent, inject the JavaScript snippet in your page HTML with one of these methods:

See Overview of Injection Types for differences between the injection methods.