Troubleshooting browser monitoring installation

If you have just configured your application for browser monitoring with New Relic Browser, wait a few minutes for data to appear. If you have already waited a few minutes and you still do not see any data, try these troubleshooting steps.

You can also troubleshoot situations where you are missing only AJAX or session trace data.

Some of these tips depend on whether you deployed your app by allowing New Relic Browser to insert the JavaScript snippet into your APM-monitored app or by inserting the JavaScript snippet yourself.

APM agent deployments

For problems with deploying apps that New Relic APM also monitors, follow these troubleshooting steps.

Enable your app

Verify that New Relic Browser has been enabled in your application's Browser settings:

  1. Go to rpm.newrelic.com/browser > (select an app) > Settings.
  2. Follow standard procedures to enable browser settings for each app.
  3. Flush your webserver cache.
  4. Wait a few more minutes for data to arrive.
  5. Try the next steps if you still do not see any data.
Update your New Relic APM agent

More recent APM agents place the page load timing scripts more accurately. Before continuing with these troubleshooting tips, make sure you have the most recent release for your APM agent.

For agent version requirements for page load timing, see Compatibility and requirements.

Verify the JavaScript snippets

Check your page's source for the two script elements required to capture metrics and send them to New Relic. In a browser, view the source of your page, and look for a script element near the beginning like this:


  <script type="text/javascript">
    (window.NREUM||(NREUM={})).loader_config={xpid:"VRUGVVJS";window.NREUM||(NREUM={}),__nr_require=function a(b,c,d){ ...

OR like this:


  <script type="text/javascript">
    window.NREUM||(NREUM={}),__nr_require=function a (b,c,d){ ...

Also verify that a second script element exists in one of two locations, depending on the app server agent language.

  • Go: Currently n/a
  • Java: Before the </body> tag (which must be added to the page if missing)
  • .NET: Immediately before the first script element
  • Node.js: Immediately before the first script element
  • PHP: At the end of the body element
  • Python: In the head element or at the end of the body element
  • Ruby: Immediately before the first script element

The second tag contains configuration and timing data, and looks like this:


  <script type="text/javascript">
    window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","errorBeacon":"bam.nr-data.net"...

If either script element is missing, continue troubleshooting with the following steps. If the script elements are present and data does not appear after several minutes, get support at support.newrelic.com.

Check other JavaScript error monitors

If you see JavaScript errors on your webpage, or if you do not see any data on your JavaScript errors page in New Relic Browser, check if any other JavaScript error monitoring frameworks have been enabled for your app. Some JavaScript error monitors may interfere with New Relic Browser's functionality.

Configure auto-instrumentation

If you are using New Relic's automatic instrumentation feature, ensure your agent is configured properly. Each agent has a configuration file setting and specific instructions to turn auto-instrumentation on or off:

If you modify your agent's configuration file, be sure to restart your app.

Verify manual API instrumentation

If you are manually calling the New Relic agent API to generate and insert the JavaScript, verify that the calls are actually being made. The APIs and how to use them are specific to your agent:

Restart your APM app

If you modified your APM agent's configuration file, be sure to restart your application so that it picks up the modified settings.

  • Java agent: Flush the app server’s "work" cache. This forces the app server to recompile.
  • .NET agent: Make sure your asp.net cache directory is clean by using the command flush_dotnet_temp.cmd. This forces the app server to recompile ASPs with page load timing instrumentation.
Verify end-user network access

If your application is loaded primarily within a secured local network, ensure that your users can reach the necessary network endpoints to report browser data. This includes New Relic's CDNs and beacon.

Copy/paste deployments

For problems with apps when you used the copy/paste deployment method for New Relic Browser, follow these troubleshooting steps.

Verify the JavaScript snippets

Check your page's source for the script element required to capture metrics and send them to New Relic. In a browser, view the source of your page, and look for a script element near the beginning like this:


  <script type="text/javascript">
    window.NREUM||(NREUM={}),__nr_require=function a (b,c,d){ ...

If the script element is missing, make sure that you have pasted it in and deployed your new code. If you have not yet pasted in the JavaScript snippet, you can copy it again from your Browser Settings page. If applicable, restart the application serving these pages.

If you still don't see the script, continue troubleshooting with the following steps.

Clear any cached versions of your pages

For the Javascript snippets to appear in pages served by your application, ensure that any cached versions of the pages from before you added the code have been cleared.

  1. Check any CDN caches.
  2. Flush your webserver cache.
Check the JavaScript placement and completeness

Insert the JavaScript as close to the top of the HEAD as possible, but after any position-sensitive META tags (X-UA-Compatible and charset). It must be outside any comments. Here is an example of the general format:

<!DOCTYPE html>
<html>
<head>
 <meta tags>
 {PLACE NEW RELIC SCRIPT TAG HERE}
 <script and link tags>
</head>
<body>
   ...
</body>
</html>

If the Javascript is correctly placed, compare it with the original snippet you generated to ensure it is complete and identical. Incomplete or modified snippets may not report correctly.

Check other JavaScript error monitors

If you see JavaScript errors on your webpage, or if you do not see any data on your JavaScript errors page in New Relic Browser, check if any other JavaScript error monitoring frameworks have been enabled for your app. Some JavaScript error monitors may interfere with New Relic Browser's functionality.

Verify end-user network access

If your application is loaded primarily within a secured local network, ensure that your users can reach the necessary network endpoints to report browser data. This includes New Relic's CDNs and beacon.

Razor framework: Check for a Parser Error Message

Using the Copy/Paste installation method in a .NET app that uses the Razor Framework, may result in this error:

Parser Error Message: "").pop().split("" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{" are valid.

The error is caused by an @ symbol in the New Relic Browser JavaScript snippet. The @ symbol represents the beginning of a code block in Razor. The line that causes the problem is:

.split("@").pop().split(":")

To fix this issue, use one of these workarounds.

  • Wrap the Browser JavaScript snippet in <text></text> tags to force it to be interpreted as content.
  • Add another @ to the line to escape it. The line will look like this:
    .split("@@").pop().split(":")

Use only one of the workarounds. Using both will break the code again.

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.