Customer.io

Overview

Customer.io is an automated messaging platform that supports strengthens the relationship between subscription businesses and their customers by sending meaningful messages at the time they're most likely to be engaged.

Connect Customer.io and Lytics to improve the precision and personalization of your email marketing. Lytics combines historical email data with rich behavioral data from your other marketing tools. This unified data helps you create audiences to make your next email campaign personal and powerful.

Authorization

If you haven't already done so, you will need to setup a Customer.io account before you begin the process described below. In order to authorize Customer.io, you will be required to provide a Site ID and API Key which Lytics uses to send data to your account. To obtain your Site ID and API key please refer to the Customer.io documentation.

If you are new to creating authorizations in Lytics, see the Authorizations documentation for more information.

  1. Select Customer.io from the list of providers.
  2. Select the API Key method for authorization.
  3. Enter a Label to identify your authorization.
  4. (Optional) Enter a Description for further context on your authorization.
  5. In the Site ID text box, enter your Site ID credential.
  6. In the API Key text box, enter your API Key credential.
  7. Click Save Authorization.
    customer-io-auth

Import Webhook Events

In order to import data from Customer.io, you need to setup the webhook to send event data to Lytics. This webhook sends behavioral events from Customer.io to Lytics in real-time. This activity data can then be used as targeting criteria for campaigns using Lytics audiences.

Integration Details

  • Implementation Type: Server-side Integration.
  • Implementation Technique: Webhook Integration.
  • Frequency: Real-time Integration.
  • Resulting Data: New or existing User Profiles containing Customer.io activity data as User Fields.

Before running the import webhook events job, it is expected that webhooks are set up in Customer.io to send event data to Lytics. Events will come in to a data stream called customerio. Lytics will do some additional processing on these events and they will be added to a stream customerio_events. From there, if the import job has been run, the incoming events will be mapped as user fields.

Fields

The following fields are included in the default mapping of the customerio_events stream:

Source FieldConditionalLytics User FieldDescriptionType
customer_idcio_customer_id unique idCustomer.io IDstring
email(email)email unique idEmail Addressstring
epochms()IF (eq(object_type, "email") AND eq(metric, "bounced"))cio_email_last_bounced_tsCustomer.io Email Last Bounced Datedate
epochms()IF (eq(object_type, "email") AND eq(metric, "clicked"))cio_email_last_clicked_tsCustomer.io Email Last Clicked Datedate
epochms()IF (eq(object_type, "email") AND eq(metric, "opened"))cio_email_last_open_tsCustomer.io Email Last Open Datedate
epochms()IF (eq(object_type, "email") AND eq(metric, "sent"))cio_email_last_send_tsCustomer.io Email Last Sent Datedate
epochms()IF (eq(object_type, "in-app") AND eq(metric, "bounced"))cio_inapp_last_bounced_tsCustomer.io In-App Last Bounced Datedate
epochms()IF (eq(object_type, "in-app") AND eq(metric, "clicked"))cio_inapp_last_clicked_tsCustomer.io In-App Last Clicked Datedate
epochms()IF (eq(object_type, "in-app") AND eq(metric, "opened"))cio_inapp_last_open_tsCustomer.io In-App Last Open Datedate
epochms()IF (eq(object_type, "in-app") AND eq(metric, "sent"))cio_inapp_last_send_tsCustomer.io In-App Last Sent Datedate
epochms()IF (eq(object_type, "push") AND eq(metric, "bounced"))cio_push_last_bounced_tsCustomer.io Push Last Bounced Datedate
epochms()IF (eq(object_type, "push") AND eq(metric, "clicked"))cio_push_last_clicked_tsCustomer.io Push Last Clicked Datedate
epochms()IF (eq(object_type, "push") AND eq(metric, "opened"))cio_push_last_open_tsCustomer.io Push Last Open Datedate
epochms()IF (eq(object_type, "push") AND eq(metric, "sent"))cio_push_last_send_tsCustomer.io Push Last Sent Datedate
epochms()IF (eq(object_type, "slack") AND eq(metric, "failed"))cio_slack_last_bounced_tsCustomer.io Slack Last Failed Datedate
epochms()IF (eq(object_type, "slack") AND eq(metric, "clicked"))cio_slack_last_clicked_tsCustomer.io Slack Last Clicked Datedate
epochms()IF (eq(object_type, "slack") AND eq(metric, "sent"))cio_slack_last_send_tsCustomer.io Slack Last Sent Datedate
epochms()IF (eq(object_type, "sms") AND eq(metric, "bounced"))cio_sms_last_bounced_tsCustomer.io SMS Last Bounced Datedate
epochms()IF (eq(object_type, "sms") AND eq(metric, "clicked"))cio_sms_last_clicked_tsCustomer.io SMS Last Clicked Datedate
epochms()IF (eq(object_type, "sms") AND eq(metric, "sent"))cio_sms_last_send_tsCustomer.io SMS Last Sent Datedate
max(epochms())IF (eq(metric, "opened") OR eq(metric, "clicked"))last_active_tsLast Activedate
set(campaign_id)cio_campaign_idsCustomer.io Campaign IDs[]string
set(campaign_name)cio_campaign_namesCustomer.io Campaign Names[]string
set(journey_id)cio_journey_idsCustomer.io Journeys[]string
set(object_type)cio_channelsCustomer.io Channels[]string
set(subject)cio_subjectsCustomer.io Subjects[]string
valuect(event)cio_eventsCustomer.io Event Countsmap[string]intsum
valuect(hash(urlmain(href)))hashedurlsHashed Urls Visitedmap[string]intsum
valuect(hourofday())IF (eq(object_type, "email") AND eq(metric, "opened"))cio_email_hourlyopensCustomer.io Email Hourly Opensmap[string]intsum

Configuring Webhooks in Customer.io

The following steps are required before running the import job.

  1. In Lytics, under Account Settings, create a new API token.
  2. Login to Customer.io, navigate to production, Admin > Integration and then Webhooks. In the URL textbox, enter the following URL: https://api.lytics.io/collect/json/customerio?key=YOUR_API_TOKEN. Replace YOUR_API_TOKEN with the Lytics token you generated in the previous step.
    webhook
  3. Click Update to save the changes.

Customer.io webhooks should now begin sending to the Lytics data stream customerio.

Configuration

This import job simply adds the necessary queries to map the webhook data as User Fields, without running this job, raw events from the webhooks will not be processed for use in the audience builder.

Follow these steps to set up and configure an import job for Customer.io in the Lytics platform. If you are new to creating jobs in Lytics, see the Data Sourcesdocumentation for more information.

  1. Select Customer.io from the list of providers.
  2. Select the Import Activity Data job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job you are creating in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. Select the Webhook checkbox if you have already set the webhook to point at Lytics. If you haven't learn how here.
  7. Click Start Import.
    customerio-import

Shortly after running the import job you should see user fields with Customer.io events populating on user profiles in your account.

Export Users

Exporting your Lytics audiences to Customer.io will create or update user data in Customer.io.

Integration Details

  • Implementation Type: Server-side Integration.
  • Implementation Technique: REST API Integration - Audience Trigger Integration.
  • Frequency: Real-time Integration.
  • Resulting Data: Lytics users that are a member of the selected audience(s) are exported to Customer.io.

This integration utilizes Customer.io API to send user data. Once the user initiates the export job, it will send the user data that is in the selected audience. For each user to export, it will create or update the user in Customer.io with the user fields selected during configuration as attributes.

Fields

Customer.io supports the following fields as listed in their documentation:

  • ID (required): which is used to identify the customer
  • Email: email address for the user
  • Attributes: Additional attributes that define the user.

Lytics allows you to send other user data fields as Extra Attributes in the job configuration.

Configuration

Follow these steps to set up and configure an export job for Customer.io in the Lytics platform.

  1. Select Customer.io from the list of providers.
  2. Select the Export Audiences job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job you are creating in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. From the Audience Name input, Select the Lytics audience to export to Customer.io.
  7. From the Unique Identifier Field input, select the Lytics user field that will be used to identify users in Customer.io.
  8. From the Email field input, select the field name that contains the user's email.
  9. (Optional) From the Extra Attributes input, select list of extra attributes to send to customer.io.
  10. (Optional) Select the Existing Users checkbox to immediately trigger pushes to users who currently exist in the selected Lytics audience.
  11. Click Start Export.
    customer-io-export