Understanding the end-to-end Salesforce integration

Connecting your Salesforce data to Customer.io is relatively easy. But getting the right data into Journeys and sending data back into Salesforce can be a bit more complex. We’ll help you connect Salesforce to Customer.io Journeys and send data from Customer.io back to Salesforce—a true, end-to-end integration between your CRM and your messaging platform.

How it works

In this recipe, you’ll set up your Salesforce source and sync some data to Customer.io. Then we’ll provide you with some common use cases to feed information back into Salesforce—so Salesforce is aware of the messages you send and the actions your customers take.

It may sound a bit confusing, but this means you’ll have Salesforce as both a sourceA source is a website or server that you want to capture data from—it’s a source of data! and a destinationA destination is a place that you want to send data from one or more sources to. You can use your own workspace as a destination; send data to another service; or send data to your data warehouse. in Customer.io!

You can send Customer.io data back into Salesforce from two different sources:

  1. Journeys Message Metrics, so Salesforce has a record of the messages you’ve sent.
  2. The Data Pipelines HTTP API, so Salesforce is aware of attribute changes you make based on logic inside Customer.io. This typically comes from the HTTP API.
the Data Pipelines connections page showing Salesforce as both a source and a destination
the Data Pipelines connections page showing Salesforce as both a source and a destination

While this recipe and our examples focus on Contacts and Accounts (people and objectsNot to be confused with a JSON object, an object in Customer.io is a non-person entity that you can associate with one or more people—like a company, account, or online course. You can use objects to message people based on changes to their company, account, or course itinerary.), the same principles apply to all your other Salesforce data, like Opportunities, Leads, and so on.

 You can send data directly from your sources to Customer.io and Salesforce

The processes above send data from Customer.io to Salesforce. But you can send data from your customer-facing sources, like your website, mobile apps, and servers, into both Customer.io and Salesforce. By sending the same data to both destinations, you’re effectively syncing your data between the two platforms.

What you’ll do

In this section, we’ll show you what you need to do with some common use cases based around your Salesforce contacts and accounts. But you can adapt these steps to your own Salesforce data and other use cases!

flowchart LR a(Set up your
Salesforce Source) a-->b(Set up syncs) b-->c(Set up your
Salesforce Destination) c-->h(Add destination
actions) h-.->|Journeys Message Metrics|e(Record email sends in Salesforce) h-.->|Journeys Message Metrics|g(Update Last Activity when
a person gets a message) h-.->|Data Pipelines API|f(Update contact in Salesforce
when person is updated in Customer.io)
  1. Set up a Salesforce source in Customer.io.
  2. Set up syncs for Contacts, Accounts, and relationships between the two.
  3. Set up your Salesforce destination to send data back to Salesforce.
  4. Set up actions determining when to send data to Salesforce, and what kinds of data to send. Depending on the kind of data you want to send, you’ll use either the Journeys Message Metrics source or the Data Pipelines HTTP API:
    1. Capture email sends in Salesforce (using the Journeys Message Metrics source).
    2. Record Last Activity for Salesforce contacts when they get messages from you (using the Journeys Message Metrics source).
    3. Advanced: Update Contacts in Salesforce based on logic in your Customer.io campaigns—like their attributes or the segments they belong to. You’ll send webhooks to the HTTP API to do this.

Relationships: a third sync for two types of data

Salesforce treats Accounts, Contacts, and relationships between the two as discrete pieces of information. So, when you sync accounts and contacts to Customer.io Journeys, you’ll also need to sync Account Contact Relationship information to capture relationships between your contacts and accounts.

The same applies to any other relationships you want to use from Salesforce. In Customer.io, you’ll map most of your Salesforce data to People or Custom Objects. But wherever you need to capture a relationship between people and a group—like opportunities, companies, etc—you’ll need to set up a relationship sync to maintain those relationships.

Dates and times

Customer.io and Salesforce use different formats for dates and times! When you sync data between the two platforms, you’ll need to convert your dates and times to the right format. We’ll show you how to do that, but, if you see an error, just know that date and time formatting is a common issue.

Customer.io Journeys uses Unix timestamps in seconds, while Salesforce uses ISO 8601 formatted dates and times.

  • Customer.io Example: 1616425200 is March 22, 2021, at 10:00:00 AM UTC
  • Salesforce Example: 2021-03-22T10:00:00Z is March 22, 2021, at 10:00:00 AM UTC

When you send data from Salesforce to Customer.io, you’ll need to go to the Customer.io destination’s Actions tab and set each action'sThe source event and data that triggers an API call to your destination. For example, an incoming identify event from your sources adds or updates a person in our Customer.io Journeys destination. Convert dates to Unix timestamps setting to true.

the convert timestamps setting for customer.io destination actions
the convert timestamps setting for customer.io destination actions

When you send data back from Customer.io to Salesforce, you’ll need to convert timestamps back to the ISO 8601 format, typically using liquidA syntax that supports variables, letting you personalize messages for your audience. For example, if you want to reference a person’s first name, you might use the variable {{customer.first_name}}..

Copied to clipboard!
  Contents
Is this page helpful?
Chat with AI