Salesforce Marketing Cloud Destination

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

Getting Started

Segment’s Salesforce Marketing Cloud destination allows you to add contacts without using SOAP APIs.

A Note About ExactTarget

ExactTarget was recently acquired by Salesforce and renamed “Salesforce Marketing Cloud.” Throughout Segment, we’ll stick to the name Salesforce Marketing Cloud, but know that the names “Salesforce Marketing Cloud” and “ExactTarget” refer to the same product.

API Access

First, you’ll need to provide Segment access to your Salesforce Marketing Cloud account. We’ll do that by creating a Salesforce Marketing Cloud application.

  1. If you don’t already have one, create a Salesforce Marketing Cloud App Center account. (This account is separate from your regular Marketing Cloud login.)
  2. If you already have apps set up, click Create New App.
  3. Click API Destination.
  4. Give your destination a name. A good default is Segment for the name, and segment for the Package name.
  5. Select “Production ExactTarget Account” and click Link to Account to link your App Center account to your Marketing Cloud account. (Alternatively, if you don’t yet have a Marketing Cloud account, you can create a new one now.) Click Next.
  6. Next, change the application’s permissions to match these settings and click Next.
  7. Review your settings (they should look something like this. Click Finish.

You should now see a Summary menu, which contains your Client ID and Client Secret.

Set Up Contact Data Storage

Segment will pass any traits you specify in an identify call through to the Identify Data Extension you specify in the Segment UI. You’ll need to create this Data Extension manually in SMC’s Contact Builder UI. When creating a Data Extension in SMC, you can set up as many or as few traits as you would like, but a good starting point for your schema is to include Segment’s standard identify traits.

Data Formatting

SMC is very strict about the format of your data, and will reject most calls that don’t fit an expected format. We format your data in a very consistent way to make setting up your destination as easy as possible.

To keep your data format consistent, predictable, and readable within SMC’s interface, we convert all your property keys to Title Case before sending them to SMC. For example, the following example data:

{
  "name": "firstLast",
  "email": "first@example.com",
  "createdAt": "1970-01-01T00:00:01.989Z"
}

or

{
  "name": "first_last",
  "email": "first@example.com",
  "createdAt": "1970-01-01T00:00:01.989Z"
}

Will both be converted into:

{
  "Name": "First Last",
  "Email": "first@example.com",
  "CreatedAt": "1970-01-01T00:00:01.989Z"
}

There are a few more things you should to know about sending data to SMC:

  • Your Identify Data Extension must have a Primary Key called Contact Key (we’ll use the userId from your Segment events to populate this field) so we can link users to SMC’s built-in Contact Key property. (Your track events can use whichever Primary Key you specify.)
  • SMC doesn’t have a good way of handling nested objects, so we exclude them from data we send over.
  • SMC accepts ISO-8601-formatted dates, and will reject any calls that include dates which don’t match that format. Be sure to send your dates in ISO format.
  • SMC ignores casing differences (e.g. created at and Created At are interpreted the same way), so don’t worry about that.
  • SMC ignores keys that don’t exist in the target data extension, so if you send a trait "nonexistent": "xyz" with your data but there’s no matching nonexistent column on SMC’s end, that trait will simply be ignored.

Identify

When you call identify, we’ll create a Salesforce Marketing Cloud Contact and upsert the user’s traits into the Data Extension you specified in the Segment UI.

Note: You must include an email trait and a userId trait with all calls; we won’t forward any identify calls that are missing both.


Track

When you call track, we’ll fire an event using Salesforce Marketing Cloud’s eventing API. This flexible API allows you to upsert information related to a contact into any Data Extension you choose.

First, you’ll need to set up event mappings in the Segment UI, which tells us which Segment events we should forward to Salesforce Marketing Cloud, and to which Data Extension we should send any given event. When you fire a mapped event through Segment, we’ll send the data through to the Data Extension you specified. These data extensions upsert data so whatever you specify as the primary key, new data will be upserted off of the value of that key. For instance, if you use “Contact Key”, we’ll pass through your calls userId as the value and that data extension will only have 1 row per userId, updated with the latest values for each attribute.

We also let you choose other properties so that you can have 1 row per product, or 1 row per transaction based on a property on your call. If you are creating a data extension table for an Order Completed event, you could use “Order Id” to grab the value from the orderId property.

Similar to our conversions above, we will titlecase all properties so order_id and orderId both become “Order Id”.

Finally, we have a checkbox, UUID Primary Key that will override whatever you have in the Primary Key Field and we will pass through a Primary Key with a key of ‘Uuid’ and the value being a UUID.

Multiple Primary Keys

If the data extension you are mapping to has more than one primary key, please enter each one seperated by a comma in the Primary Key Field. For example, if your primary keys were “Contact Key” and “Product Id”, you would just enter “Contact Key, Product Id” (without the quotations). The ordering is not important.

Features

Contextual Properties

Our destination with SFMC supports passing in many of the contextual properties that our SDK’s and libraries collect automatically as Data Extension attributes. Please reference our documentation for more information on contextual properties and the SDK’s/libraries that collect them.

In order to take advantage of this functionality, you will need to create attributes in your Data Extensions that adhere to specific naming conventions. The table below outlines the Segment contextual properties availble with this feature and the corresponding Data Extension attribute names they will map to.

app.nameApp Name
app.versionApp Version
app.buildApp Build
campaign.nameUTM Campaign
campaign.sourceUTM Source
campaign.mediumUTM Medium
campaign.termUTM Term
campaign.contentUTM Content
localeLocale
userAgentUser Agent
ipIP Address
device.adTrackingEnabledAd Tracking Enabled
device.manufacturerDevice Manufacturer
device.modelDevice Model
device.nameDevice Name
device.typeDevice Type
network.bluetoothBluetooth Enabled
network.carrierNetwork Carrier
network.cellularCellular Enabled
network.wifiWifi Enabled
screen.densityScreen Density
screen.heightScreen Height
screen.widthScreen Width

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.

Settings

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

Client ID

Your Salesforce Marketing Cloud Client ID. For instructions on how to find your Client ID, check out our documentation.

Client Secret

Your Salesforce Marketing Cloud Client Secret. For instructions on how to find your Client Secret, check out our documentation.

Conversion events

Use these fields to map your Segment event names to Salesforce Marketing Cloud Data Extensions. We’ll only send SMC the conversion events you specify.

Identify Data Extension External Key

The External Key of the Salesforce Marketing Cloud Data Extension to which you’d like to send Identify data. You can find this in the SMC interface by navigating to Data & Analytics > Contact Builder > Data Extensions; the extension’s name will appear in the External Key column.


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!