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.

Prerequisites

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 have a Pro + SPA subscription and deploy a new JavaScript snippet that includes SPA monitoring:

  1. Go to rpm.newrelic.com/browser > 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 via New Relic APM agent: If possible, restart your app and clear server-side cache to ensure the APM agent picks up the change and deploys the new JavaScript snippet.

Wait a few minutes for New Relic Browser to start collecting SPA monitoring data, then go to rpm.newrelic.com/browser > (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.

screen-browser-spa-enable070816.png
rpm.newrelic.com/browser > (select an app) > Browser app > Settings > Application settings: Select the Pro + SPA option, agree to the Terms of Service, and save your application settings. If you originally used the copy and paste method to deploy your app to New Relic Browser, replace the JavaScript snippet with the new one for SPA monitoring.

The bottom of the generated JavaScript 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.

Disable SPA monitoring

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

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

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.