Loading…

Create Tasks in Salesforce from your Customer.io messages

Updated

You can send message information to Salesforce—the emails you send, whether or not people click them, and so on. In Salesforce, you’ll typically record these events as Tasks. When you send message events to Salesforce, you’ll need to map a few fields to make sure that Salesforce processes your message activity tasks properly.

Set up an action to create tasks in Salesforce

 You must use Salesforce’s Contact ID as people identifiers in Customer.io

You must associate each task with a person (typically a contact) in Salesforce by their Contact ID or Lead ID. We’re working on a way to make this easier, but for now, you cannot send tasks to Salesforce if you don’t use the same identifiers in Customer.io that you use in Salesforce. Generally, this means that you sync your Salesforce contacts to Customer.io and use the Contact IDs as their IDs in Customer.io.

You may want to set up different actions for different kinds of events, depending on the data you want to associate with people. But typically, you can set up a single action to send all message events to Salesforce as tasks.

  1. Go to your Salesforce integration’s Actions tab and click Add Action.
  2. In the Action dropdown, select Custom Object.
    The action dropdown showing the custom object option
    The action dropdown showing the custom object option
  3. In the Trigger step, make sure Any conditions are true.
  4. Set the first condition to Track Event Name is Email Sent.
  5. (Optional) Click Add Condition and repeat the previous step but set the event name for each message event you want to capture.
    The action trigger step with conditions showing track event name set to email sent and email link clicked
    The action trigger step with conditions showing track event name set to email sent and email link clicked
  6. For the Operation, select Create new record.
    The salesforce operation field showing the operation set to create a new record
    The salesforce operation field showing the operation set to create a new record
  7. Scroll down and set the Salesforce Object to Task.
    The salesforce object field showing the object set to Task and other fields filled in
    The salesforce object field showing the object set to Task and other fields filled in
  8. Next to Other Fields, click Add Key/Value and map the following fields. Note that when you map fields, any values that contain a $ are variables! You’ll need to type them in the drop-down Variables box when you select a field rather than directly in the text field. an animate gif showing how to map fields in salesforce
    FieldValueDescription
    TaskSubtypeEmailSalesforce has a limited number of task subtypes, but this is the one that best reflects messages.
    Subject$.event: $.properties.subjectThis is what your tasks will show in Salesforce. For example: Email Sent: Subject Line. We type a plain : value in between the event and the subject line to make it easier to read in Salesforce.
    PriorityNormalOther available values are High and Low.
    StatusCompletedMessage events occur after the event, so the status is always completed.
    OwnerIdThis is the Salesforce User you want to associate with this task. You’ll find this in the URL of a user in Salesforce. For example: User/003TH000004n83lYAA/view. See Finding your Owner ID for more information.
    WhoId$.properties.userIdThis is the Salesforce Contact ID of the person your messages are for.
    ActivityDate$.timestampThis is the date and time of the event.

Find your Owner ID

Salesforce tasks reference two people: the Contact or Lead that the task is for (represented by the WhoId field) and the Salesforce user who is responsible for the task. This is the OwnerId field that you’ll set when you set up your action.

The message events that we send to Salesforce to create tasks follow a specific format. While they contain a value representing the WhoId of the person your messages are for, they don’t contain a value for the OwnerId, and there’s no way to pass this value in the events.

That means that you’ll set a static OwnerId for all of the tasks coming from Customer.io—all your tasks are owned by the same Salesforce user. It may help to create a new Salesforce user to act as the owner of all your Customer.io tasks.

In Salesforce, you’ll find a UserID in the URL when you look at a user’s profile—for example, User/003TH000004n83lYAA/view.

The Salesforce user page showing the owner ID in the URL
The Salesforce user page showing the owner ID in the URL

Message event triggers

You’ll set up your action to create tasks in Salesforce for the different kinds of “message events” you want to capture. The process above works for all message events, but you’ll need to set up your action’s trigger with all the different message events that you want to capture in Salesforce. These are the available message events in Customer.io:

NameDescription
Email DraftedCustomer.io successfully rendered a message and populated 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}}. for an individual recipient. The message is ready to send.
Email AttemptedAn email that couldn’t be sent to the delivery provider will be retried.
Email DeferredAn email that the delivery provider couldn’t send will be retried by the delivery provider.
Email SentAn email was sent from Customer.io to the delivery provider.
Email DeliveredThe delivery provider reported the email was delivered to an inbox.
Email OpenedAn email was opened.
Email Link ClickedA tracked link in an email was clicked.
Email ConvertedA person matched a conversion goal attributed to an email.
Email UnsubscribedA person unsubscribed via a particular email.
Email BouncedThe delivery provider was unable to deliver the email.
Email DroppedAn email wasn’t sent because it was addressed to a person who was suppressed.
Email Marked as SpamAn email was marked as spam by the recipient.
Email FailedAn email couldn’t be sent to the delivery provider.
Push DraftedCustomer.io successfully rendered a push notification and populated 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}}. for an individual recipient. The message is ready to send.
Push AttemptedA push notification that couldn’t be sent to the delivery provider will be retried.
Push SentA push notification was sent from Customer.io to the delivery provider.
Push DeliveredA push notification was delivered to a recipient. You must use our SDKs or report delivered metrics to us using the API.
Push OpenedThe app on a person’s device reported the push notification was opened. You must use our SDKs or report opened metrics to us using the API.
Push Link ClickedA tracked link in a push notification has been clicked. Note that we do not track Clicked metrics or enable link tracking for push notifications by default. When a person taps a push notification, the message is marked as Opened. If you want to track links specifically, you’d need to send this metric back to us through the metric reporting API.
Push ConvertedA person matched a conversion goal attributed to a push notification.
Push BouncedThe delivery provider reported at least one invalid device token.
Push DroppedA push notification wasn’t sent because at least one device token previously bounced.
Push FailedA push notification couldn’t be sent to the delivery provider.
Push UndeliverableA push notification was undeliverable, likely because it hit a message limit.
SMS DraftedCustomer.io successfully rendered an SMS message and populated 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}}. for an individual recipient. The message is ready to send.
SMS AttemptedAn SMS that couldn’t be sent to the delivery provider will be retried.
SMS SentAn SMS was sent from Customer.io to the delivery provider.
SMS DeliveredThe delivery provider reported the SMS was delivered.
SMS Link ClickedA tracked link in an SMS has been clicked.
SMS ConvertedA person matched a conversion goal attributed to an SMS.
SMS BouncedThe delivery provider was unable to deliver the SMS.
SMS FailedAn SMS couldn’t be sent to the delivery provider.
SMS UndeliverableAn SMS message was undeliverable, likely because it hit a message limit.
Slack DraftedCustomer.io successfully rendered a slack message and populated 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}}. for an individual recipient. The message is ready to send.
Slack AttemptedA slack message that couldn’t be sent will be retried.
Slack SentA slack message was sent from Customer.io to slack.
Slack Link ClickedA tracked link in a slack message has been clicked.
Slack FailedA slack message couldn’t be sent to slack.
Slack UndeliverableA Slack message was undeliverable, likely because it hit a message limit.
Webhook DraftedCustomer.io successfully populated a webhook with 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}}. and is ready to send it.
Webhook AttemptedA webhook that couldn’t be sent will be retried.
Webhook SentA webhook was sent from Customer.io to the specified Webhook URL.
Webhook Link ClickedA tracked link in a webhook payload has been opened.
Webhook FailedA webhook couldn’t be sent to the specified Webhook URL.
In-App DraftedCustomer.io successfully rendered an in-app message and is ready to send it.
In-App AttemptedAn in-app that couldn’t be sent will be retried.
In-App SentAn in-app was sent.
In-App OpenedAn in-app was opened.
In-App ClickedA tracked response in an in-app was clicked.
In-App ConvertedA person matched a conversion goal attributed to an in-app.
In-App FailedAn in-app couldn’t be sent.
Copied to clipboard!
  Contents
Is this page helpful?