The browser APIs allow you to customize and extend your . 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 API |
---|---|
Track an action that New Relic doesn't automatically track | |
Add an object to an in-progress session trace | |
Record a time point when your page is finished according to custom criteria | |
Add an attribute name and value to subsequent events on the page | |
Add application version information to subsequent events on the page | |
Group page views by setting a page name | |
Add user id information to subsequent events on the page | |
Capture a single browser log event | |
Automatically capture messages passing through your existing logger methods as log events |
Report errors
To report errors in your application, use these methods:
If you want to... | Use this API |
---|---|
Tag errors with your app's version information | |
Capture a caught or handled error without disrupting your app's operation | |
Selectively ignore a known error |
Track single page apps (SPA only)
To track single page applications, use these SPA API methods:
If you want to... | Use this API |
---|---|
Set the | |
Trace sub-components of a SPA interaction separately |
|
End a SPA interaction | |
Aggregate data associated with the current interaction | |
Ignore an interaction | |
Return a new API object bound to the current interaction | |
Adjust attributes, such as name and ignored attributes, before the interaction is recorded | |
Ensure a browser interaction will be saved when it ends | |
Add a custom attribute to the current interaction | |
Give SPA routes more accurate names than default names |
Control agent data collection behaviors
To control agent harvesting behaviors, use these API methods:
If you want to... | Use this API |
---|---|
Prevent feature(s) from harvesting until manually triggered | |
Manually start session replay collection | |
Manually pause session replay collection |