Cordial Cloud Mode Integration Beta
2 minute read
After you have successfully instrumented Cordial as a destination in RudderStack, follow this guide to correctly send your events to Cordial in cloud mode.
Find the open source transformer code for this destination in the GitHub repository.
Identify
You can use the identify call to create or update a contact in Cordial. RudderStack uses the Contacts API to send this data.
Make sure to create the contact attributes in the Cordial dashboard before sending them in youridentifyevents.
A sample identify call is shown:
rudderanalytics.identify("1hKOmRA4GRlm", {
name: "Alex Keener",
email: "alex@example.com",
logins: 2,
}, {
externalId: [{
type: "cordialContactId",
id: "12345"
}, ],
});Supported mappings
RudderStack maps the following identify fields to the corresponding Cordial properties:
| RudderStack property | Cordial property | Note |
|---|---|---|
traits.emailcontext.traits.emailEither email or externalId.id is required. | channels.email.address | - |
context.externalId.idEither email or externalId.id is required. | cID | externalId.type should be set to cordialContactId (Cordial-generated database identifier). |
traits.subscribedStatuscontext.traits.subscribeStatus | channels.email.subscribeStatus | |
traits | attributes | User traits except the email and subscribeStatus fields. |
Track
You can use the track call to track and create a contact’s activity in Cordial. RudderStack uses the Contact Activities API to send this data.
Make sure to create a contact in Cordial using anidentifycall before sending thetrackevents for that contact.
A sample track call is shown:
rudderanalytics.track(
"Product Reviewed", {
review_id: "86ac1cd43",
product_id: "9578257311",
rating: 4.0,
review_body: "Good product.",
}, {
externalId: [{
type: "cordialContactId",
id: "12345",
}, ],
},
);Cordial has reserved some event names that automatically generate an activity record. Hence, do not use these names while sending yourtrackevents to Cordial.
Supported mappings
RudderStack maps the following track fields to the corresponding Cordial properties:
| RudderStack property | Cordial property | Note |
|---|---|---|
eventRequired | a | - |
context.externalId.idtraits.emailcontext.traits.emailRequired | contact identifier | externalId.type should be set to cordialContactId (Cordial-generated database identifier). |
properties | properties | - |
timestamporiginalTimestamp | ats | ISO 8601 date in the format yyyy-MM-ddTHH:mm:ss.SSSZ.For example: 2022-02-01T19:14:18.381Z |