RudderStack lets you send your event data to Iterable via the device mode using the native web SDK.
Identify
For the identify call, RudderStack uses either Iterable's setEmail or setUserId method to identify a given user. You can configure this using the Identifier to identify a user over a session setting in the RudderStack dashboard.
identify call is necessary to associate the track events and trigger the web push notifications for an identified user.email over userId.A sample identify call is shown below:
rudderanalytics.identify("", {    "email": "alex@example.com"},{ "integrations": {    "ITERABLE": {        "jwt_token" : "eyJhbGciOiJIUzXXXXXXXXX6IkpXVCJ9.eyJlbXXXXXXXXhc2hhc3ZpQHJ1ZGRlcnN0XXXXXXXXXXdCI6MTY2NTAzMTkzNCwiZXhwIjXXXXXXXXxNjY2MDMxOTM0fQ.u0wwq6YOB2GXXXXXXXXX2O9GUpW6BHRF5PCmk"    }}})When you call identify, RudderStack initializes the SDK using the email/userId and the JWT token from the integrations object.
Track
RudderStack supports the following three types of track events in web device mode:
Purchase events
You can map certain track events to Iterable's purchase events (API reference) by specifying them in the Mapping to trigger the purchase events setting of the RudderStack dashboard, as shown:
    A sample track call for a purchase event is shown below:
rudderanalytics.track("purchase event", {  checkout_id: "12345",  order_id: "1234",  affiliation: "Apple Store",  total: 20,  revenue: 15.0,  shipping: 22,  tax: 1,  discount: 1.5,  coupon: "ImagePro",  currency: "USD",  products: [{      product_id: "123",      sku: "G-15",      name: "Chess",      price: 14,      quantity: 1,      category: "Games",      url: "https://www.mywebsite.com/product/path",      image_url: "https://www.mywebsite.com/product/path.jpg",    }  ],})The following table lists the mappings between the RudderStack event properties and the Iterable properties in case of the purchase events:
| RudderStack property | Iterable property | 
|---|---|
properties.name Required  | items[].name | 
properties.order_id properties.checkout_id Required  | id | 
properties.total Required  | total | 
properties.product_id | items[].id | 
properties.sku | items[].sku | 
properties.price | items[].price | 
properties.quantity | items[].quantity | 
properties.image_url | items[].url | 
The above properties can be passed in any of the following ways:
propertiesobject (for a single product), as shown in the above table.productsarray as multiple objects (for multiple products), for example,properties.products[0].name. One example where you can have an array of products is the Order Completed event.
getInAppMessages events
You can send this type of track events to track the users in-app activities and accordingly display pop-up messages and push notifications for them. The below image shows an example of a web push notification:
    You can map these events by specifying them in the Mapping to trigger the getInApp messages setting of the RudderStack dashboard, as shown:
    You can also customize the display configuration for the push notifications using the In-app message settings in the RudderStack dashboard.
getInAppMessages events are triggered, the SDK delivers all the queued in-app notifications.A sample track call mapped to Iterable's getInAppMessages events is shown below:
rudderanalytics.track("trigger event",{})Custom events
RudderStack sends all the track events that are not mapped to Iterable's purchase events or getInAppMessages events as custom events.
A sample custom track event is shown below:
rudderanalytics.track(  "custom event", {    custom_id: "22222",    name: "Some item",    website_url: "http://www.exampledomain.com/products/some-item",  })The following table lists the mappings between the RudderStack event properties and the Iterable properties in case of the custom events:
| RudderStack property | Iterable property | 
|---|---|
event Required  | eventName | 
userId Required, if email is not present.  | userId | 
context.traits.email Required, if userId is not present.  | email | 
properties | dataFields | 
Contact us
For more information on the topics covered on this page, email us or start a conversation in our Slack community.