Troubleshoot AJAX data collection

Problem

You are not seeing AJAX data for your New Relic Browser application.

Solution

If your application is instrumented with New Relic Browser and is correctly collecting other Browser Pro data, follow these steps:

1. Verify you use XMLHttpRequest.

Check whether your application uses the XMLHttpRequest object to make AJAX calls.

  • Browser monitoring: Other methods (including the newer Fetch API) currently are not supported when using New Relic Browser Pro.
  • Single-page app monitoring: Fetch is supported for AJAX requests within a BrowserInteraction when using New Relic's SPA monitoring.

If you are making requests using JSONP, see JSONP requirements.

2. Verify the object is instrumented.

If you are using XMLHttpRequest, use your browser's dev console to verify that the object has been instrumented by New Relic. Enter the object name at your console.

If instrumentation has succeeded, the console should return something like:

function (t){var e=new p(t);try{u.emit("new-xhr"...

If instrumentation failed, you will see something like:

function XMLHttpRequest() { [native_code] }

If you see this type of failure response, see Troubleshooting Browser monitoring installation. If you see a different response, you may be using another script or library that is conflicting with New Relic instrumentation. Contact support at support.newrelic.com.

3. Verify network access.

If the object is properly instrumented, try triggering an AJAX call in your application while monitoring network traffic in the browser's developer tools. Wait up to one minute, and look for a call to bam.nr-data.net/jserrors with an xhr parameter. If the call fails, check for network issues.

If you don't see this call, if it fails with an error not related to network access, or if it succeeds but you still aren't seeing data, get support at support.newrelic.com.

If your requests use JSONP, see requirements and notes on functionality below:

JSONP requirements

If your requests use JSONP, these requests will not appear on the AJAX UI page. However, you can view them as assets within Browser's session traces. If using SPA monitoring, you can view them on the Breakdown tab of the Page views page.

Requirements for JSONP to be recognized by New Relic Browser:

  • Each JSONP request must use a unique callback function. Most popular libraries (e.g. jQuery) generate a unique callback function dynamically for each request.
  • The query string callback must be named "callback" or "cb" in order to be recognized by New Relic. This is the default behavior in most popular libraries.

For more help

Additional documentation resources include:

For more help

Recommendations for learning more: