Salesforce Marketing Cloud (SFMC) is a marketing automation solution that helps marketers with email, mobile, social, and online marketing automation. Use this integration to stream SFMC events such as email sent, email open, email click or SMS sent and SMS not sent actions, in a near real-time manner and have them in TD CDP for further decision-making.

Features of this integration:

The following event data can be selected and streamed to Treasure Data from SFMC:

You can set the destination for data as:

This feature is in beta. Contact your Customer Success representative for more information.

Learn more about:




You need to complete the SFMC Package API Integration Setup which requires obtaining the SFMC Client ID and Secret first.

Obtaining SFMC Client ID and Secret

These instructions guide you to locate the client ID and client secret that is necessary to authenticate using credentials.

Go to Setup > Apps > Installed Packages.
Select New.
Type the Name and Description of the Package.
Select Save.

Locate the newly created Package in the list of installed packages.
Select the package name.
 Select Add Component.
Select API Integration 

Select Server-to-Server. 

Select EVENT NOTIFICATIONS options as showing in the following.

These options allow us to run operations for read/create/update/delete for callbacks and subscriptions.

OAuth 2.0 Scopes for Using API for SFMC Package Setup

If you use the API to get the credentials, then the following scopes need to be specified:


Copy Client Id and Client Secret.
    • Both are needed when you create the Connection in TD.
Copy Authentication Base URI and Rest Base URI.
    • Both are needed when you create the Source in TD.

Use the TD Console to Create Your Connection

Create a New Connection

In Treasure Data, you must create and configure the data connection before running your query. As part of the data connection, you provide authentication to access the integration.

Open TD Console.
Navigate to Integrations Hub  Catalog.
Search for and select Salesforce Marketing Cloud Data Streaming.
Select Create Authentication.

The following dialog opens.

Edit the following parameters:
Client IDRequired

The Client ID of your Salesforce Marketing Cloud.

See Obtaining SFMC Client ID and Secret.
Client SecretRequired

The Client Secret of your Salesforce Marketing Cloud.

See Obtaining SFMC Client ID and Secret.
TD API KeyRequired

TD write-only API Key for access to the database.

See Getting Your API Keys.

Select Continue.
Enter a name for your connection.
Select Done.

Transfer Your Data to Treasure Data

After creating the authenticated connection, you are automatically taken to the Authentications listing page.

Search for the connection you created. 
Select New Source.
Type a name for your Source in the Data Transfer field.
Select Next.

The Source Table dialog opens.

Edit the following parameters:
DatastoreRequiredPlazma is the only option available now.
TagsOptionalTags can be used to find this source
DatabaseRequiredSpecify the database within Treasure Data for which you want to import data into.
TableRequiredSpecify the table within the database where you would like the data placed.
Authorization EndpointRequiredAuthenticate URL. The endpoint that you want to use to provide the authorization. 
Rest API EndpointRequiredThe Salesforce REST API endpoints.
Event CategoriesRequiredWithin event categories, you can add and specify as many event types as are necessary for your environment.
Event TypeRequired

 Events can be generated, triggered by the system, or initiated by user action.

Review the list of values and select event types that you want to monitor.

Select Create.

 Source Id should be treated with caution.

Data Preview 

Data Ingestion