The browser APIs allow you to customize and extend your browser monitoring. To begin using the APIs, ensure the browser agent is present on every page you want to monitor.
Below are use cases for each browser API method.
Traces and events
To monitor traces and events, use these methods:
If you want to... | Use this |
---|---|
Track an action that New Relic doesn't automatically track | Use |
Add an object to an in-progress session trace | Use |
Record a time point when your page is finished according to custom criteria | Use |
Add an attribute name and value to subsequent events on the page | Use |
Group page views by setting a page name | Use |
Report errors
To report errors in your application, use these methods:
If you want to... | Do this |
---|---|
Tag errors with your app's version information | Use |
Log a caught or handled error, without disrupting your app's operation | Use |
Selectively ignore a known error | Use |
Track single page apps (SPA only)
To track single page applications, use these SPA API methods:
If you want to... | Do this |
---|---|
Set the | Use |
Trace sub-components of a SPA interaction separately | Use |
End a SPA interaction | Use |
Aggregate data associated with the current interaction | Use |
Ignore an interaction | Use |
Return a new API object bound to the current interaction | Use |
Adjust attributes, such as name and ignored attributes, before the interaction is recorded | Use |
Ensure a browser interaction will be saved when it ends | Use |
Add a custom attribute to the current interaction | Use |
Give SPA routes more accurate names than default names | Use |