Segment.com: Customer.io as a Source

Set up Customer.io as a Segment Source, piping email data out of Customer.io and into any one of Segment’s hundreds of Destination integrations. Data is sent to Segment in track() calls.

 We only send events for people with id values

If your workspace uses id and email as IdentifiersThe attributes you use to add, modify, and target people. Each unique identifier value represents an individual person in your workspace., this integration only sends events to Segment for people who have an id.

Enable Customer.io as a Segment source

To enable Customer.io as a Segment source, you need both a Customer.io and a Segment.com account. If you are creating a new Segment account, enter “Customer.io” in the How Did You Hear About Us? field.

  1. In the Segment interface, Go to Connections, click Add Source, and select Customer.io

  2. Give your source a Name and a Label, and click Add Source. The Name helps you identify your source in Segment, and the label helps you organize sources in your Segment workspace.

    Segment Sources setup
    Segment Sources setup

  3. On the Overview page, copy your Write Key.

    Segment Sources write key
    Segment Sources write key

  4. In your Customer.io workspace, go to Settings > Integrations and click the Segment Source integration. You can find it in the Data Management category.

  5. Paste your Write Key in the field and click Connect Segment.

  6. Enable the events you want to send from Customer.io to Segment.

    Select events to send to segment
    Select events to send to segment

  7. In Segment, turn on the destinations you want to send your Customer.io data to.

Track Payloads: confirm that your Segment Source works

You can confirm that your Customer.io Source is working by sending a test campaign to yourself and checking the debugger. Customer.io sends the following events to Segment. Click any event to see an example of the track payload for each event type:

Email Delivered
{
  "context": {
    "integration": {
      "name": "customer.io",
      "version": "1.0.0"
    },
    "library": {
      "name": "unknown",
      "version": "unknown"
    },
    "traits": {
      "email": "cool.person@example.com"
    }
  },
  "event": "Email Delivered",
  "integrations": {
    "Customer.io": false
  },
  "messageId": "api-1u21CJeZPJX3TdLhPNrzstyAYZa",
  "originalTimestamp": "2021-06-16T13:04:06Z",
  "properties": {
    "action_id": "n16",
    "action_name": "Test Name",
    "campaign_id": 1,
    "campaign_name": "Test Name",
    "delivery_id": "dgP6xQb6xQYDAAF6FOl-vmR0E7zoPqTRiAo=",
    "email_id": "dgP6xQb6xQYDAAF6FOl-vmR0E7zoPqTRiAo=",
    "email_subject": "Test Subject"
  },
  "receivedAt": "2021-06-16T13:05:39.605Z",
  "sentAt": "2021-06-16T13:05:39.000Z",
  "timestamp": "2021-06-16T13:04:06.605Z",
  "type": "track",
  "userId": "cool-person"
}
Email Opened
{
  "context": {
    "integration": {
      "name": "customer.io",
      "version": "1.0.0"
    },
    "library": {
      "name": "unknown",
      "version": "unknown"
    },
    "traits": {
      "email": "cool.person@example.com"
    }
  },
  "event": "Email Opened",
  "integrations": {
    "Customer.io": false
  },
  "messageId": "api-1u21CJeZPJX3TdLhPNrzstyAYZa",
  "originalTimestamp": "2021-06-16T13:04:06Z",
  "properties": {
    "action_id": "n16",
    "action_name": "Test Name",
    "campaign_id": 1,
    "campaign_name": "Test Name",
    "delivery_id": "dgP6xQb6xQYDAAF6FOl-vmR0E7zoPqTRiAo=",
    "email_id": "dgP6xQb6xQYDAAF6FOl-vmR0E7zoPqTRiAo=",
    "email_subject": "Test Subject"
  },
  "receivedAt": "2021-06-16T13:05:39.605Z",
  "sentAt": "2021-06-16T13:05:39.000Z",
  "timestamp": "2021-06-16T13:04:06.605Z",
  "type": "track",
  "userId": "cool-person"
}
Email Link Clicked
{
  "context": {
    "integration": {
      "name": "customer.io",
      "version": "1.0.0"
    },
    "library": {
      "name": "unknown",
      "version": "unknown"
    },
    "traits": {
      "email": "cool.person@example.com"
    }
  },
  "event": "Email Link Clicked",
  "integrations": {
    "Customer.io": false
  },
  "messageId": "api-1u242Y8g1XCtEl9rEp7NwBx3K9o",
  "originalTimestamp": "2021-06-16T13:29:01Z",
  "properties": {
    "action_id": "n18",
    "action_name": "Test Name",
    "campaign_id": 3,
    "campaign_name": "[Copy] [Copy] Test Name",
    "delivery_id": "dgP6xQb6xQYDAAF6FQJvh4yaVoIOMGeCVp4=",
    "email_id": "dgP6xQb6xQYDAAF6FQJvh4yaVoIOMGeCVp4=",
    "email_subject": "Test Subject",
    "link": {
      "id": 1,
      "url": "https://customer.io/features"
    }
  },
  "receivedAt": "2021-06-16T13:29:03.021Z",
  "sentAt": "2021-06-16T13:29:02.000Z",
  "timestamp": "2021-06-16T13:29:02.021Z",
  "type": "track",
  "userId": "cool-person"
}
Email Marked as Spam
{
  "context": {
    "integration": {
      "name": "customer.io",
      "version": "1.0.0"
    },
    "library": {
      "name": "unknown",
      "version": "unknown"
    },
    "traits": {
      "email": "cool.person@example.com"
    }
  },
  "event": "Email Spammed",
  "integrations": {
    "Customer.io": false
  },
  "messageId": "api-1u21CJeZPJX3TdLhPNrzstyAYZa",
  "originalTimestamp": "2021-06-16T13:04:06Z",
  "properties": {
    "action_id": "n16",
    "action_name": "Test Name",
    "campaign_id": 1,
    "campaign_name": "Test Name",
    "delivery_id": "dgP6xQb6xQYDAAF6FOl-vmR0E7zoPqTRiAo=",
    "email_id": "dgP6xQb6xQYDAAF6FOl-vmR0E7zoPqTRiAo=",
    "email_subject": "Test Subject"
  },
  "receivedAt": "2021-06-16T13:05:39.605Z",
  "sentAt": "2021-06-16T13:05:39.000Z",
  "timestamp": "2021-06-16T13:04:06.605Z",
  "type": "track",
  "userId": "cool-person"
}
Email Bounced
{
  "context": {
    "integration": {
      "name": "customer.io",
      "version": "1.0.0"
    },
    "library": {
      "name": "unknown",
      "version": "unknown"
    },
    "traits": {
      "email": "cool.person@example.com"
    }
  },
  "event": "Email Bounced",
  "integrations": {
    "Customer.io": false
  },
  "messageId": "api-1u21CJeZPJX3TdLhPNrzstyAYZa",
  "originalTimestamp": "2021-06-16T13:04:06Z",
  "properties": {
    "action_id": "n16",
    "action_name": "Test Name",
    "campaign_id": 1,
    "campaign_name": "Test Name",
    "delivery_id": "dgP6xQb6xQYDAAF6FOl-vmR0E7zoPqTRiAo=",
    "email_id": "dgP6xQb6xQYDAAF6FOl-vmR0E7zoPqTRiAo=",
    "email_subject": "Test Subject"
  },
  "receivedAt": "2021-06-16T13:05:39.605Z",
  "sentAt": "2021-06-16T13:05:39.000Z",
  "timestamp": "2021-06-16T13:04:06.605Z",
  "type": "track",
  "userId": "cool-person"
}
Unsubscribed
{
  "context": {
    "integration": {
      "name": "customer.io",
      "version": "1.0.0"
    },
    "library": {
      "name": "unknown",
      "version": "unknown"
    },
    "traits": {
      "email": "cool.person@example.com"
    }
  },
  "event": "Unsubscribed",
  "integrations": {
    "Customer.io": false
  },
  "messageId": "api-1u21MrfL8kIJwhuNanhhBbuc9gq",
  "originalTimestamp": "2021-06-16T13:05:55Z",
  "properties": {
    "action_id": "n17",
    "action_name": "Test Name",
    "campaign_id": 2,
    "campaign_name": "[Copy] Test Name",
    "delivery_id": "dgP6xQb6xQYDAAF6FOsF0yqZiIo1NgezYcI=",
    "email_id": "dgP6xQb6xQYDAAF6FOsF0yqZiIo1NgezYcI=",
    "email_subject": "Test Subject"
  },
  "receivedAt": "2021-06-16T13:07:04.404Z",
  "sentAt": "2021-06-16T13:07:04.000Z",
  "timestamp": "2021-06-16T13:05:55.404Z",
  "type": "track",
  "userId": "cool-person"
}

If these events flow into your Segment debugger, you’ll know that the Source is properly enabled.

segment_sources_debugger.png
segment_sources_debugger.png

Enabling ID in an email-based workspace

If you have an email-based workspace—a workspace in which you only identify people by email— and you want to change your workspace configuration to support id as an identifier, you must disable your Segment Source integration first.

As a Segment Source, Customer.io sends track calls to Segment. Customer.io maps a single identifierThe attributes you use to add, modify, and target people. Each unique identifier value represents an individual person in your workspace.id or email, depending on your workspace configuration—to the userId in the Segment track call.

When you enable id as an identifier in a workspace that previously was previously email-based, the mapped identifier changes. We require you to turn off your integration so that you don’t inadvertently identify duplicate people with new identifier values in Segment.

Customer.io Workspace Identifier(s) identifier mapped to Segment userId
ID only id
email only email
ID and email id

To handle this mismatch, in Segment userId values, you can:

  • Disable your Segment Source integration, change your workspace to enable id as an identifier, and then resume your integration. Your integration will start sending track() calls using id rather than email.
  • Contact The Customer.io Product Team to tell us how you want to handle identifiers in Segment, and wait to enable id in your workspace until we update the Segment Source integration to handle different identifiers.

Need help?

Copied to clipboard!