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.

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;
    }
});
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;
    }
});
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>
Excluding Network Requests