Treasure Data can publish user segments into Salesforce Marketing Cloud (ExactTarget), and enable you to send personalized emails to your customers. You can run data-driven email campaigns, by using your first party data from Web, Mobile, CRM, and other data sources.
For sample workflows of this, view Treasure Boxes.
Treasure Data provides two methods to write job results to Salesforce Marketing Cloud (SFMC), our SFTP and SFMC plugins.
This SFMC plugin can be used for small and medium data sets. We recommend you use SFTP for large data sets.
Synchronous or Asynchronous API
This data connector supports two kinds of APIs to put records into SFMC: Synchronous APIs and Asynchronous APIs.
As a best practice, if you are trying to put a result set with less than 100,000 records into SFMC, Synchronous APIs is a great fit. However, if you are planning to send a million+ data set, then consider using Asynchronous APIs because it provides higher availability and reliability in comparison with Synchronous APIs.
In order to use the Asynchronous APIs, you must ensure that your SFMC account is enabled as a Data Extensions Async REST API from Salesforce Marketing Cloud. You can also create a support case in Salesforce Marketing Cloud to have them enable it.
Replace or Upsert Existing Audience Data in a Data Extension
This data connector also supports two modes to perform with existing data in a data extension--Upsert and Replace.
Upsert Audience Data
The first mode is Upsert which updates existing data and inserts any new additional data in the data extension. Both update or insert operations will use the data extension primary key to determine if a record existed or not in order to perform update or insert. All the existing data in the target data extension remains.
Replace Audience Data
The second mode is Replace which means before updating data, we will clear all existing data in the target data extension. This mode useful if you need only the newest data in the data extension each time in order to send an email to targeted customers every time.
When you use this mode, the deleted data is unrecoverable. The connector will clear all the data before pushing new data which means whether your job succeeds or fails, the data will be cleared.
As a best practice, use this mode with data that is temporary and when data history is not important.
In order to use this mode, your account must be an Enterprise 2.0 account and the installed package must have admin privileges. Contact your Customer Success representative to find out more.
Prerequisites
Basic knowledge of Treasure Data
Basic knowledge of Salesforce Marketing Cloud
TD account
This connector also requires that the Data Extension have a primary key that uniquely identifies each record.
Create an Installed App in Salesforce Marketing Cloud
Treasure Data supports several versions for Salesforce Marketing Cloud.
Enhanced Package: We highly recommend that you use the Salesforce Marketing Cloud V2 Export Integration. Rather than the legacy integration.
Create a Legacy Package
Log on to your Salesforce Marketing Cloud account
On the Welcome Page, select your name on top right corner and select Setup.
Navigate to App > Installed Packages.
On the Installed Packages screen, select New.
In New Package Details, enter the Name and Description. Clear Create with enhanced functionality (recommended).
Select Save.
On the Package Details screen, select Add Component.
On Add Component, select API Integration. Select Next.
On the Add API Integration screen, scroll to Contacts > Audiences and to Contacts > List and Subscribers.
Select Read and Write under both in order to use Replace Audience feature.
Scroll down to the Data > Data Extensions.
Select Read and Write. You need these permissions to write data to Salesforce Marketing Cloud.
Select Save.
On the Installed Packages screen, scroll down to the Components panel. Copy down the Client Id and Client Secret. You use that information to write the data from Treasure Data to Salesforce Marketing Cloud.
Using TD Console
Complete the following steps to export TD query results to a Salesforce Marketing Cloud Data Extension:
Create a New Data Connection
When you configure a data connection, you provide authentication to access the integration. In Treasure Data, you configure the authentication and then specify the source information.
Open TD Console.
Navigate to Integrations Hub > Catalog.
Search for and select Salesforce Marketing Cloud.
The following dialog opens. Select a Legacy Package Integration.
Create a Legacy Package Integration
In the New Authentication dialog, select Legacy Package, then enter the Client Id and Client Secret (which you obtained when you created legacy package in SFMC). Select Continue.
Enter a Name for this integration and select Done.
Configure Export Results in Your Data Connection
In this step, you create or reuse a query. In the query, you configure the data connection.
Sometimes you need to define the column mapping in the query.
Configure the Connection by Specifying the Parameters
Open the TD Console.
Navigate to Data Workbench > Queries > New Query.
Enter your query in the query editor.
Select Export Results located at top of your query editor.
The Choose Integration dialog opens.
You have two options when selecting a connection to use to export the results, using an existing connection or creating a new one.
Use an Existing Connection
Type the connection name in the search box to filter.
Select your connection.
On the Export Results screen, enter a Data Extension Name.
Select one of the following:
To use Asynchronous API, select the Using Async API checkbox. To use the Synchronous API, leave the box clear.
Continue on failure.
Select Done.
Run the Query
Select Run to run the query.
Check the query results are written to the configured data extension.
Plugin Configuration and Options
Available Configurations
Configuration name | Description | Type | Sample value |
---|---|---|---|
| Installed package client key | string |
|
| Installed package client secret | string |
|
| Authenticate type | string |
|
| Authenticate URI (required if auth_type=v2) | string |
|
| Data Extension name | string |
|
| Flag to indicate create new data extension if it does not exist | boolean default is false |
|
| Flag to indicate created DE is sendable or not | boolean default is false |
|
| Your account’s configured sendable business rule (required if is_sendable=true) | string |
|
| Column name to use as sendable property (required if is_sendable=true | string |
|
| Flag to indicate using asynchronous or synchronous API from SFMC | boolean default is false |
|
| Flag to indicate continue running if there is an insertion error (applied only for synchronous API) | boolean default is true |
|
Example Configurations
Example configuration for using Synchronous APIs to upsert data extension using the Legacy package.
out: type: salesforce_marketing_cloud client_id: Th1s1s4n3x4mpl3Cl13nt1ds client_secret: Th1s1s4F4k3dCl13ntS3cr3t auth_type: v1 de_name: data_extension_name continue_on_failure: false
Example configuration for Asynchronous APIs to upsert data extension using the Legacy package.
out: type: salesforce_marketing_cloud client_id: Th1s1s4n3x4mpl3Cl13nt1ds client_secret: Th1s1s4F4k3dCl13ntS3cr3t auth_type: v1 de_name: data_extension_name async: true
When Replace is Selected
If:
There is a data error (NULL value, wrong data type, invalid primary key) in the exported results, all the records in the Data Extension are cleared and not recoverable, but the invalid data is not exported.
There is a schema error (missing primary_key) in the exported results, the existing records in the data extension are not cleared.