Install the New Relic Browser agent

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

For a library of videos about how to get started with New Relic Browser, how to enable and configure it, and how to get the most out of the user interface, visit learn.newrelic.com.

Select a deployment option

No matter which option you use to deploy New Relic Browser, the result is the same: injecting the New Relic Browser JavaScript snippet into your pages for browser monitoring. The method you select depends on your preferences and business needs:

New Relic 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 New Relic APM. (APM-monitored apps are listed on your New Relic 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 New Relic Browser JavaScript snippet. This is useful for standalone apps, static sites, and cached pages delivered by CDN; or when your APM app is 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 New Relic REST API lets you manage deployment outside the New Relic Browser UI. This is useful for large organizations deploying multiple apps.

Using an APM agent API to manually instrument

For apps that are monitored by New Relic 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 New Relic APM:

  1. Go to rpm.newrelic.com/browser > Add more.
  2. From the New Relic Browser deployment page, select Enable via New Relic APM.
  3. Select your choice of available options for Browser agent instrumentation features, based on your New Relic subscription level.
  4. Type or use the search window to find the app's name.
  5. Select Enable.
  6. Wait a few minutes for New Relic Browser to start collecting data, then select your app from the Browser applications index.

If data does not start to appear after a few minutes, or if you experience other problems, follow the procedures to troubleshoot browser monitoring installation.

Enable with copy/paste

Use this procedure to insert New Relic 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 New Relic Browser license key and application ID. This is useful with the New Relic REST API and API Explorer.

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

    • If your app is monitored by New Relic APM, select Yes, then type or use the search window to find the app's name.
    • If you have a standalone app for New Relic Browser (not monitored by New Relic APM), select No, then type the app's name.
  5. Select Generate snippet.
  6. Copy the code snippet that automatically appears, then paste it 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).
  7. Wait a few minutes for New Relic Browser to start collecting data, then select your app from the Browser applications index.

If data does not start to appear after a few minutes, or if you experience other problems, follow the procedures to troubleshoot browser monitoring installation.

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 Settings page or via the New Relic REST API (v2).

For more help

Additional documentation resources include:

Discuss Browser monitoring in the New Relic Online Technical Community! Troubleshoot and ask questions, or discuss JavaScript error reporting or AJAX timing in detail.

If you need additional help, get support at support.newrelic.com.