Install the Browser monitoring agent

Browser uses a JavaScript snippet (or "agent") to instrument your app's webpages. The JavaScript collects data for browser monitoring. To install the Browser agent, you can choose from a number of deployment options.

To use Browser and the rest of our observability platform, join the New Relic family! Sign up to create your free account in only a few seconds. Then ingest up to 100GB of data for free each month. Forever.

Select a deployment option

No matter which option you use to deploy Browser, the end result is to inject the Browser agent's JavaScript snippet into your pages for browser monitoring. The method you select depends on your preferences and business needs. To view the procedure to install and enable the Browser agent, click the link for the option you want to use. You can also use the Browser Application settings page to update settings.

Browser deployment option Description
Use the APM agent to inject the JavaScript

You can use an APM agent to automatically inject the browser monitoring JavaScript snippet for you. This is the easiest way to install the agent for an app that already is being monitored by APM. (APM-monitored apps are listed on your APM Applications index.)

Paste the JavaScript snippet into a webpage

This allows you to control the exact placement of the JavaScript into your app's webpage(s) by copying and pasting the Browser agent's JavaScript snippet. This is useful for:

  • Standalone apps, static sites, and cached pages delivered by CDN
  • APM apps that are not as closely coupled to the browser app as with a standard server-side app (for example, when your client-side app talks to a REST API back end)
Enable single-page app (SPA) monitoring

Enabling SPA requires a Pro + SPA subscription, and you may need to re-deploy the Browser JavaScript agent.

Use the REST API

The REST API lets you manage deployment outside the Browser UI. This is useful for large organizations deploying multiple apps.

Use an APM agent API to manually instrument the JavaScript snippet

For apps that are monitored by APM, you can use the APM agent's API to inject the JavaScript manually instead of automatically.

Enable an APM-monitored app

Use this procedure to automatically deploy the Browser agent on an app that is monitored by APM:

  1. Go to one.newrelic.com > Browser > [plus-circle icon] Add more.
  2. From the Browser deployment page, select Enable via APM.
  3. Select your choice of available options for Browser agent instrumentation features.
  4. Type or use the search window to find the app's name.
  5. Select Enable.

    Node.js: To finish enabling the Browser agent for a Node.js app, follow the additional procedure to insert the JavaScript header into the beginning of your HTML page's head tag.

  6. Generate some traffic for your app.
  7. Wait a few minutes for Browser to start collecting data, then select your app from the Browser applications index.

Enable with copy/paste

Use this procedure to insert Browser's JavaScript snippet for browser monitoring into your app's webpages yourself. This option is useful for monitoring static sites (such as Jekyll) or cached pages delivered by CDN.

Near the bottom of the generated JavaScript is your Browser license key and application ID. This is useful with the REST API and API Explorer.

  1. Go to one.newrelic.com > Browser > Add more.
  2. From the Browser deployment page, select Copy/Paste JavaScript Code.
  3. Select your choice of available options for Browser agent instrumentation features.
  4. Name your app:

    • If your app is monitored by APM, select Yes, then type or use the search window to find the app's name.
    • If you have a standalone app for Browser (not monitored by APM), select No, then type the app's name.
  5. Select Generate snippet.
  6. Copy the code snippet that automatically appears, then paste it inline into your pages as close to the top of the <head> element as possible, but after any position-sensitive <meta> tags (for example, X-UA-Compatible or charset information). For more information on the inline head placement, see JavaScript placement requirements.
  7. Generate some traffic for your app.
  8. Wait a few minutes for Browser to start collecting data, then select your app from the Browser applications index.

If you use the copy/paste method but do not finish the setup process, you can still view and copy the generated JavaScript snippet from your app's Browser Application settings page or by using the REST API (v2).

Instrument webpages using the APM agent

This information applies to apps that are also monitored by APM.

New Relic's agents can instrument webpages with the required JavaScript for page load timing. If you use the APM agent to add the JavaScript snippet to your webpages, insert the instrumentation snippet as close to the top as possible. This allows you to take advantage of detailed information about Browser's AJAX calls and JavaScript errors.

For more information, see the instructions for your agent:

Troubleshoot Browser agent installation

When you enable Browser Pro features for session traces, AJAX calls, or JavaScript errors, it may take approximately five minutes before information becomes available. If you have problems with your Browser installation or if no data appears after five minutes, refer to the troubleshooting tips, and restart your agent.

For more help

If you need more help, check out these support and learning resources: