Install Single Page App monitoring with New Relic Browser

SPA monitoring uses a JavaScript snippet to instrument your app's webpage and collect data for monitoring. To enable your app for SPA monitoring in New Relic Browser, use the same method you used when you originally deployed New Relic Browser for your app, either:

  • Automatically through the user interface
  • Copying and pasting the JavaScript snippet directly into your webpage

Access to this feature depends on your subscription level. Single page app (SPA) monitoring is only available with New Relic Browser Pro.


In order to deploy SPA monitoring, you must:

  • Make sure your app and Browser agent version meet New Relic's compatibility and requirements.
  • Agree to the Terms of Service, which automatically appears during the setup process for the first app you select for your account. By agreeing to the Terms, you authorize New Relic to collect hash fragments from URLs. You only need to select the checkbox option once for your account.

Enable SPA monitoring

To deploy SPA monitoring for your app, you must already have a Pro subscription. Then, you must enable Pro + SPA monitoring, and deploy a new JavaScript snippet that includes SPA monitoring.

The bottom of the generated JavaScript snippet includes your New Relic Browser license key and application ID. This is useful, for example, when using the New Relic REST API (v2) or API Explorer.

  1. Go to > (select an app) > Settings > Application settings, then select Pro + SPA.
  2. Agree to the Terms of Service.
  3. Select Save application settings.
  4. Deploy the new JavaScript snippet:

    • If you deploy Browser with the copy/paste method: Copy the entire JavaScript code snippet. Paste it as close to the top of the HEAD of your webpage as possible, but after any position-sensitive META tags (for example, X-UA-Compatible or charset information).
    • If you deploy using a New Relic APM agent: If possible, restart your app and clear the server-side cache to ensure the APM agent picks up the change and deploys the new JavaScript snippet.
  5. Generate some traffic, then wait a few minutes for New Relic Browser to start receiving SPA monitoring data.

To view SPA data: Go to > (select an app) > Page views. If SPA data does not start to appear in the Page views page after a few minutes, see New Relic Browser's troubleshooting procedures.

Disable SPA monitoring

To opt out of New Relic Browser's SPA monitoring feature:

  1. Go to > (select an app) > Settings > Application settings.
  2. Select a different agent version/loader option.
  3. Select Save application settings.

For more help

Recommendations for learning more: