How to filter selective destinations

Filter selective destinations while sending your event data via RudderStack.

RudderStack lets you send your event data only to certain destinations by filtering out the rest.

Send events to specific destinations

To send events to specific destinations using the JavaScript SDK, pass an integrations object in the options parameter of your event method.

info
Some RudderStack SDKs follow their own conventions different to the below examples - notably iOS and Android. See their respective documentation for the correct event filtering format.

The following example demonstrates how to send an event only to HubSpot and Intercom using the JavaScript SDK:

rudderanalytics.identify(
  "1hKOmRA4GRlm", {
    email: "alex@example.com",
    name: "Alex Keener",
  }, {
    integrations: {
      All: false,
      "HubSpot": true,
      "Intercom": true,
    },
  }
)
info

Note that:

  • All is always set to true unless explicitly set to false. This means RudderStack sends the event to all destinations by default.
  • All: false instructs RudderStack to not send the event to all destinations.

Disable events for specific destinations

You can also disable sending event data to specific destinations. In this case, RudderStack sends the event data to all the other destinations except the specified ones.

rudderanalytics.identify(
  "1hKOmRA4GRlm", {
    email: "alex@example.com",
    name: "Alex Keener",
  }, {
    integrations: {
      "HubSpot": false,
      "Intercom": false,
    },
  }
)

In the above code snippet, RudderStack will send the event data to all destinations except HubSpot and Intercom.

Examples

This section includes some track() calls sent from a variety of SDKs to the specified destinations.

JavaScript SDK

rudderanalytics.track(
  "Page Viewed", {
    email: "alex@example.com",
    name: "Alex Keener",
  }, {
    integrations: {
      All: false,
      "Amazon S3": true,
      "Heap.io": true,
    },
  }
)

Python SDK

rudder_analytics.track(
  "Page Viewed", {
    "email": "alex@example.com",
    "name": "Alex Keener"
  },
  integrations = {
    "All": False,
    "Amazon S3": True,
    "Heap.io": True
  },
)

In the above examples, RudderStack SDKs send the track events only to the Amazon S3 and Heap.io destinations.

Destination naming convention

To filter the destinations, you must specify the exact destination names. To get these names, go to the RudderStack directory.

warning
The destination names are case sensitive.

Questions? Contact us by email or on Slack