Version:

Events Filtering in JavaScript SDK

Filter events sent to downstream destinations using the JavaScript SDK.

This guide covers the following event filtering use cases:

Filter destinations while loading SDK

You can filter all events sent to web device mode destinations by passing an integrations object in the load API options. RudderStack then loads and sends events only to the allowed (and enabled) destinations.

A sample snippet to send event data only to the Amplitude and Intercom destinations:

rudderanalytics.load(WRITE_KEY, DATA_PLANE_URL, {
    integrations: {
        All: false,
        "Amplitude": true,
        "Intercom": true
    }
});

Filter destinations at event level

You can control filtering a single event to the allowed (and enabled) destinations.

A sample track event instrumentation to send the event only to the Amplitude destination:

rudderanalytics.track(
    "Order Completed", {
        revenue: 30,
        currency: "USD",
        user_actual_id: 12345
    }, {
        integrations: {
            All: false,
            "Amplitude": true
        }
    }
);
warning

The destination name in the integrations object should match the name exactly as displayed in the RudderStack dashboard, as shown:

It should not be the name that you have assigned while setting up the destination in RudderStack.

Client-side event filtering

When you send events to a destination via web device mode, you can use the Client-side Events Filtering feature to configure the track events that should be discarded or allowed to flow through.


Questions? Contact us by email or on Slack