docs »
browser-agent »
tips-and-tricks »
Exclude Analytics Network Requests
If your application makes frequent network requests that are irrelevant to your debugging, such as calls out to analytics services, you may want to exclude them from your Network Telemetry. You can add a filter to the onError
callback to easily remove them.
Global
Module
Legacy
window.TrackJS && TrackJS.install({
token: "{TOKEN} ",
onError: function(payload) {
payload.network = payload.network.filter(function(item) {
return (item.url.indexOf("my-analytics-service.com") === -1)
});
return true;
}
});
Copy
Excluding Network Requests
import { TrackJS } from "trackjs";
TrackJS.install({
token: "{TOKEN} ",
onError: function(payload) {
payload.network = payload.network.filter(function(item) {
return (item.url.indexOf("my-analytics-service.com") === -1)
});
return true;
}
});
Copy
Excluding Network Requests
<script>
window._trackJs = {
token: "{TOKEN} ",
onError: function(payload) {
payload.network = payload.network.filter(function(item) {
return (item.url.indexOf("my-analytics-service.com") === -1)
});
return true;
}
};
</script>
<script src="https://cdn.trackjs.com/releases/current/tracker.js"></script>
Copy
Excluding Network Requests