Customer.io is a popular platform for sending automated messages and emails to your customers, with a focus on security and privacy. With Customer.io, you get complete information about your customers in one place, and use it to create personalized messages and campaigns for them.

RudderStack supports Customer.io as a destination to which you can seamlessly send your event data.

Find the open source transformer code for this destination in the GitHub repository.

Getting started

RudderStack supports sending event data to Customer.io via the following connection modes:

Connection ModeWebMobileServer
Device modeSupported--
Cloud modeSupportedSupportedSupported
In the web device mode integration, that is, using JavaScript SDK as a source, the Customer.io native SDK is loaded from https://assets.customer.io/ domain. Based on your website's content security policy, you might need to allowlist this domain to load the Customer.io SDK successfully.

Once you have confirmed that the platform supports sending events to Customer.io, follow these steps:

  1. From your RudderStack dashboard, add the source. From the list of destinations, select Customer.io.
  2. Assign a name to the destination and click on Continue. You should then see the following screen:
Customer.io connection settings

Connection settings

The connection settings required to configure Customer.io as a destination in RudderStack are listed below:

  • Site ID: Enter your Customer.io site ID.
  • API Key: Enter your Customer.io API key.
For more information on obtaining your Customer.io site ID and API key, refer to the FAQ section below.
  • Event sent after setting device token: Enter the name of the event that is fired immediately after setting the device token.
  • Account based in the EU data center?: Enable this option in case your account is based in the EU region.
Refer to the Customer.io documentation for more information on this setting.

Web device mode settings

  • Use native SDK to send events: Enable this setting to send the events through Customer.io's native JavaScript SDK.
  • OneTrust Cookie Category: Specify the OneTrust category name for mapping the OneTrust consent settings to RudderStack's consent purposes.
For more information on this setting, refer to the OneTrust Consent Manager guide.

Finally, click on Next to complete the setup. Customer.io will now be enabled as a destination in RudderStack.

Identify

The identify call sends the event data to Customer.io along with the properties that you pass as the RudderStack traits.

userId is a mandatory field for Customer.io. If it is not provided, RudderStack uses anonymousId instead.

RudderStack also sends the createdAt field as created_at to Customer.io to register the user signup time.

A sample identify call is as shown:

rudderanalytics.identify("userId", {
name: "Tintin",
city: "Brussels",
country: "Belgium",
email: "tintin@herge.com"
});

As createdAt is not present in the above call, RudderStack will append the current timestamp value and send the field to Customer.io.

The same email cannot be used to make consecutive identify calls with different userId.

Unsubscribing users

You can pass unsubscribed: true in the identify call to unsubscribe a user in Customer.io, as shown in the following snippet:

rudderanalytics.identify("userId", {
email: "tintin@herge.com",
unsubscribed: true
});
Make sure the user ID and the email values match the Customer.io attributes. You can verify this by selecting that user in the People page in your Customer.io dashboard and clicking on Attributes.

Page

If you are using a native SDK, the Customer.io JavaScript snippet is loaded and captures the page view automatically. You can also call rudderanalytics.page() that sends the page event along with any associated properties that you want to pass along with the call.

A sample page call is as shown below:

// "home" is the name of the page.
rudderanalytics.page("home", {
path: "path",
url: "url",
title: "title",
search: "search",
referrer: "referrer",
});

Screen

The screen call lets you record whenever your user views their mobile screen, with any additional relevant information about the screen.

If you have turned on the screen views in your app implementation from the iOS or Android SDK, they will be registered as Viewed <screen_name> Screen under the Activities tab for the user.

RudderStack will also forward the event properties passed along with the screen call to Customer.io as they are received.

A sample screen call using RudderStack's iOS SDK is shown below:

[[RudderClient sharedInstance] screen:@"Main"
properties:@{@"prop_key" : @"prop_value"}];

The above event will be transformed as Viewed Main Screen and sent to Customer.io.

Track

The track call lets you capture user events along with the properties associated with them.

A sample track call is as shown below:

rudderanalytics.track("Track me", {
category: "category",
label: "label",
value: "value",
});
For anonymous users, Customer.io does not allow an event name of size more than 100 Bytes. RudderStack will automatically trim the event names in such a scenario.

Alias

The alias call lets you merge different identities of a known user. RudderStack merges the attributes of both the user identities by retaining the attributes of the primary identity and merging the additional attributes of the secondary identity.

A sample alias call is as shown below:

rudderanalytics.alias("test_new_id", "old_user_id");
The alias call is applicable only when both the users are present in Customer.io.

Device token registration

RudderStack registers the device token to Customer.io for the following application lifecycle events:

  • Application Installed
  • Application Opened

To use this feature, enable the trackApplicationLifecycleEvents feature in your mobile SDK implementation code. Also, you need to register your device token after initializing the SDK.

The following snippets demonstrate registering the device token for iOS and Android:

[[[RudderClient sharedInstance] getContext] putDeviceToken:[self getDeviceToken]];
RudderClient.putDeviceToken(getDeviceToken())

Alternatively, you can also enter the preferred event name during the Customer.io destination configuration in the RudderStack dashboard, as shown:

Customer.io device token settings
Make sure you send the event just after setting the device token in your app, so RudderStack can immediately register the device token on that event and not delay until the next lifecycle event.

The following snippets highlight sending the device_token_registered event after setting the device token in your app:

[[RSClient sharedInstance] track:@"device_token_registered"];
rudderClient!!.track("device_token_registered")

RudderStack also supports the removal of the device (identified by device_id) whenever a custom event Application Uninstalled is sent to Customer.io.

FAQ

Where do I find the API Key and Site ID for configuring Customer.io in RudderStack?

To obtain the API Key and Site ID, follow these steps:

  1. Sign into your Customer.io dashboard.
  2. In the left panel, click on Settings and select Account Settings.
  3. Then, click on API Credentials. You should find the site ID and API key for your project listed here, as shown:
Customer.io site ID and API key

Contact us

For more information on the topics covered on this page, email us or start a conversation in our Slack community.

On this page