Customer.io Destination

Segment makes it easy to send your data to Customer.io (and lots of other destinations). Once you've tracked your data through our open source libraries we'll translate and route your data to Customer.io in the format they understand. Learn more about how to use Customer.io with Segment.

Our Customer.io destination code is all open-source on GitHub if you want to check it out: Javascript,(iOS and Android work via the server destination).

Getting Started

When you turn on Customer.io in Segment, this is what happens:

  • Our CDN is updated within 5-10 minutes. Then our snippet will start asynchronously loading Customer.io’s track.js onto your page. This means you should remove Customer.io’s snippet from your page.
  • Since Customer.io only records custom events and custom user data, no events or users will appear in Customer.io until you start using the API outlined below.

To finish the setup, you’ll have to go into your Customer.io account and enter your Segment write key in their destination settings. Find the right place in Customer.io by clicking Settings > Integrations > Segment.

Identify

When you call identify on analytics.js, we call identify on Customer.io. For an email to appear in the People view, you must provide an email as a trait labeled email.

When you call identify from one of our server-side languages, we’ll create/update a customer with any traits you provide. We recommend you provide an email as traits.email. Note that Customer.io accepts up to 30 unique traits per identify event.

To unsubscribe a user, simply pass in user_id, email and unsubscribed in an identify event. Be sure the user_id and email match the values in Customer.io, which you can find in the overview section under the attributes column within an individual user’s view in the Customer.io dashboard. Here is an example of how to unsubscribe a user in analytics-ruby:

Analytics.identify(
  user_id: 'dswkg5w',
  traits: {
    email: 'testing-dswkg5w@segment.com',
    unsubscribed: true
  }
)

Note: if you are using our HTTP API to send a bunch of identify calls to Customer.io at once, make sure you throttle the import to 100-200 requests per second.

Track

When you call track, we’ll send the event to Customer.io with the event name and properties you provide.

Note: if you are using our HTTP API to send a bunch of events to Customer.io at once, make sure you throttle the import to 100-200 requests per second.

Sending Data from Customer.io

Customer.io supports sending email events to other tools on the Segment platform. These events will be sent as track calls to the other destinations you’ve turned on.

To enable this feature, go to the Account Settings in Customer.io and add your Segment write key:

Send email events from Customer.io

Troubleshooting

No Events in Customer.io from the Browser

Remember that before we can send events to Customer.io from client-side javascript the current user must be identified with both a userId and email. The email address can be recorded as the userId if you don’t have another unique identifier for that user.


Supported Sources and Connection Modes

WebMobileServer
📱 Device-based
☁️ Cloud-based

To learn more about about Connection Modes and what dictates which we support, see here.

We offer an optional Cloud-based Connection Mode for Web data with Customer.io. As a reminder, this removes the Customer.io javascript library from your site, improving performance.

Settings

Segment lets you change these destination settings via your Segment dashboard without having to touch any code.

API Key

You can find your API Key on the Customer.io Integration page. It should be 20 or 64 characters long, and look something like this: 91837a6c9e8b49d0ef71. An API Key is required if you’re using our server-side or mobile libraries.

Site ID

You can find your Site ID on the Customer.io Integration page.


If you have any questions or see anywhere we can improve our documentation, please let us know or kick off a conversation in the Segment Community!