If you have just configured your application with , 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 tips. Some of these tips depend on whether you deployed your app by allowing browser monitoring to automatically insert the JavaScript snippet into your APM-monitored app or by inserting the JavaScript snippet yourself.
Solution
Recommendation: Before following specific troubleshooting procedures, run the Diagnostics browser checks. Once Diagnostics CLI is downloaded, target the browser checks by running the command-line options: /nrdiag -browser-url YOUR-WEBSITE-URL -suites browser. The information returned from Diagnostics CLI can be used when communicating with New Relic Support.
If your browser monitoring agent was deployed for an account monitored with an agent, see APM deployments. If your browser monitoring agent was deployed using the JavaScript copy/paste method, see Copy/paste deployment. If you are unsure which you have, the Diagnostics tool will return the deployment method.
You can also troubleshoot situations where you are missing only AJAX or session trace data.
Deployment via APM agent
These troubleshooting steps apply to problems when the browser monitoring agent is installed on an app already being monitored by an APM agent:
Verify that browser monitoring has been enabled in your application's Browser settings:
Try the next steps if you still do not see any data.
More recent 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.
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:
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.
If you see JavaScript errors on your webpage, or if you do not see any data on your Errors page in the New Relic UI, check if any other JavaScript error monitoring frameworks have been enabled for your app. Some JavaScript error monitors may interfere with functionality for browser monitoring.
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.
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:
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 that the JavaScript is on the page as detailed in the previous step Verify the JavaScript snippets. If it is not on the page, use the manual instrumentation as detailed in Verify manual API instrumentation. The Javascript must be present on your page before you can proceed to the next step.
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.
Deployment via JavaScript copy/paste
These troubleshooting steps apply to problems when New Relic's browser monitoring agent was deployed using the HTML copy/paste method:
Verify that browser monitoring has been enabled in your application's Browser settings:
Try the next steps if you still do not see any data.
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:
<scripttype="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 app's Settings page. If applicable, restart the application serving these pages.
If you still don't see the script, continue troubleshooting with the following steps.
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.
Check any CDN caches.
Flush your webserver cache.
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:
<!DOCTYPEhtml>
<html>
<head>
<metatags>
{PLACE NEW RELIC SCRIPT TAG HERE}
<scriptandlinktags>
</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.
If you see JavaScript errors on your webpage, or if you do not see any data on your JavaScript errors page in the New Relic UI, check if any other JavaScript error monitoring frameworks have been enabled for your app. Some JavaScript error monitors may interfere with functionality for browser monitoring.
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.
If you use the copy/paste installation method in a .NET app that uses the Razor Framework, this may result in the following error:
Parser Error Message: "").pop().split("" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{" are valid.
error CS0103: The name 'nr' does not exist in the current context
The error is caused by an @ symbol in the JavaScript snippet for browser monitoring . The @ symbol represents the beginning of a code block in Razor. The line that causes the problem is:
.split("@").pop().split(":")
"@nr="
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.
OR
Add another @ to the line to escape it. Check that the line looks like this:
.split("@@").pop().split(":")
"@@nr="
Use only one of the workarounds. Using both will break the code again.