How to Send Destination-specific Data in Event Payload

Learn how to use the integrations object to send destination-specific configuration or data in the event payload.

This guide demonstrates how to use the integrations field of the RudderOption instance to send destination-specific configuration or data in the event payload.

Overview

You can set the <Destination> parameter of the integrations object to an object — this object can contain any specific configuration or data that you want to send to that destination in both cloud and device modes.

info

Note that:

  • When you set the <Destination> parameter to an object, the SDK automatically assumes this parameter to be true.
  • The SDK does not persist the information set using the integrations field across different events. Therefore, you must pass this parameter every time you want to send destination-specific data within an event payload.

Send destination-specific configuration or data

In the following example, the integrations object is used to specify a Mailjet configuration that removes the user from a Mailjet list (with the ID 13314el9Z).

After making the above call, the external ID information gets attached to the context.externalId field and integrations information gets attached to the integrations key at the root level. The final payload will look as follows:

{
  //.....
  "context": {
    //......
    "externalId": [{
      "id": "13314el9Z",
      "type": "listId"
    }],
    //......
  }
  //.....
  "integrations": {
    "All": false,
    "Mailjet": true
  },
  //.....
}

Questions? Contact us by email or on Slack