Skip to content
Last updated

Salesforce Marketing Cloud Import Integration V2

Salesforce Marketing Cloud enables marketing professionals to deliver the right message at the right time through all the phases of the customer journey. With this integration, you can import Salesforce Marketing Cloud Data Source objects into Treasure Data.

Collect contact information and campaign data.  Collect email event, send data about your customers, such as follows:

  • Emails opened
  • Links clicked
  • Forwarded or bounced email
  • Survey data
  • Unsubscribe requests

You have import options such as:

  • individual email event types or multiple-user email event types
  • incremental import Email Event object based on the eventDate timestamp

You can use the same connection to export SFMC data. See Salesforce Marketing Cloud v2 Export Integration.

To see sample workflows for importing Salesforce Marketing Cloud data, go to Treasure Boxes.

Prerequisites

  • Basic knowledge of Treasure Data
  • Basic knowledge of Salesforce Marketing Cloud

Limitation

Occasionally, data imported using this integration experiences data inconsistency issues because boolean values are incorrectly or inconsistently imported. A symptom of this data inconsistency is that VARCHAR or BIGINT values are saved as false with a string data type or 0 as BIGINT when the value shown in Salesforce Marketing Cloud is True or False.

Treasure Data recommends that you follow the Salesforce integration migration instructions.

Create an Install Package in Salesforce Marketing Cloud

After August 1st, 2019, you can not create a Legacy Package in Salesforce Marketing Cloud, therefore we highly recommend that you create an Enhanced Package.

Create a Legacy Package

Log on to your Salesforce Marketing Cloud account

On the Welcome Page, select your name on the top-right corner then select Setup.

On the left side menu of the new screen, select App > Installed Packages.

On the Installed Packages screen, select New.

On the New Package Details pop up, enter the Name and Description. Uncheck (deselect) thecheckbox Create with enhanced functionality (recommended) then select Save.

On the Package Details screen, select Add Component.

On the Add Component pop up, select API Integration then select Next.

On the Add API Integration screen:

  • Scroll to the CHANNELS section and select the Read checkbox on Email
  • Scroll to the CONTACT section and select the Read checkbox on Audiences and List and Subscribers
  • Scroll to the DATA section and select the Read and Write checkbox on Data Extensions, Read for Tracking Events
  • Scroll to HUB section and select the Read checkbox on the Campaign

On the Installed Packages screen, scroll down to the Components panel, then take note of the Client Id and Client Secret. You use the information to write the data from Treasure Data to Salesforce Marketing Cloud.

How to Create Enhanced Functionality Package

  1. Log on to your Salesforce Marketing Cloud account.

  2. On the Welcome Page, select your name on the top-right corner then select Setup.

  3. On the left side menu of the new screen, select App > **Installed Packages.

    **

  4. On the Installed Packages screen, select New.

  5. On the New Package Details pop up, enter the Name and Description and selectthecheckbox Create with enhanced functionality (recommended).

  6. Select **Save.

    **

  7. On the Add Component pop up, select API Integration then select **Next.

    **

  8. On the Choose Your Integration Type screen, select Server-to-Server and then select Next.

  9. On the Set Server-to-Server Properties screen:

    1. Scroll to the CHANNELS section and select the Read checkbox on Email

    2. Scroll to CONTACT section and select the Read checkbox on Audiences and List and Subscribers

    3. Scroll to DATA section and select the Read and Write checkbox on Data ExtensionsReadfor Tracking Events

    4. Scroll to HUB section and select the Read checkbox on the **Campaign

      **

  10. On the Installed Packages screen, scroll down to the Components panel, then take note of the Client Id, Client Secret and Authentication Base URI. You will use the information to write the data from Treasure Data to Salesforce Marketing Cloud.

Use the TD Console to Create Your Connection

You can use TD Console to create your data connector.

Create a new 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.

Go to Integrations Hub > Catalog and search and select Salesforce Marketing Cloud.

Create Legacy Package Integration

On the New Authentication screen, select Package Type as Legacy Package, then enter the Client Id and Client Secret (which you obtained when you created legacy package in SFMC).

Tenant Authentication Base URI is the Authentication Base URL (which you obtained when you created legacy package in SFMC). You need to enter this value as of September 2022 as Marketing Cloud is going to deprecate the legacy endpoints

[https://*.exacttargetapis.com]. For more information: https://help.salesforce.com/s/articleView?id=000356497, https://help.salesforce.com/s/articleView?id=000356498

Select Continue.

Enter a Name for this integration and select Done.

Create Enhanced Package Integration

On the New Authentication screen, select Package Type as Enhanced Functionality Package, then enter the Client Id, Client Secret, and Authentication Base URI (which you obtained when you created the enhanced package in SFMC). Optionally, you could specify Account identifier or MID to access multiple BUs (more detail in How to get MID) and Scope to limit the token's scope (more detail in API scopes). Select Continue.

Enter a Name for this integration and select Done.

Create a New Transfer

After creating the connection, you are automatically taken to Sources. Look for the connection you created and select New Transfer.

The following dialog opens. Complete the details and select Next.

Next, you see a Preview of your data similar to the following dialog. To make changes, select Advanced Settings otherwise, select Next.

From here, if you want to change some options such as skipping on errors or rate limits and connection timeout, select Advanced Settings:

Select the database and table where you want to transfer the data:

Specify the schedule of the data transfer using the following dialog and select Start Transfer:

You will see the new data transfer in progress listed under the My Input Transfers tab and a corresponding job are listed in the Jobs section.

Available Targets

TargetDescription
CampaignThe e-mail campaign
ContactThe contact list
Data ExtensionsThe data extensions to satisfy the need for flexible data storage
Email EventsThe events associated with an email marketing send
Email Events OnlyThe email events data
SendThe email marketing send

In some cases, your data breaks because some attributes are faulty. You can use the option Attribute set names will be ignored to skip faulty attributes. This option helps you ingest data from Salesforce Marketing Cloud’s API without error.

The target Data Extensions provides an option to filter data extensions you want to ingest and another option to enable ingesting shared data extensions.

  • The log debug info: When enabled, detailed debug information, including the request ID, will be logged (default: false)

The target Email Events provides an option to filter:

  • Email name matching pattern (exact or partial match)
  • Email events type that you want to ingest
  • Two options to define a date range to ingest events on a specific date-time range.

The target Email Events provides an option to extract emails per batch

  • An option to specify the number of emails to include in one batch (used to fine-tune in case of extreme performance in SFMC side)

  • Email name matching pattern (exact or partial match): number of emails in a batch, used to fine-tune the amount of data to smaller chunk.

  • Default: 2500

  • The log debug info: When enabled, detailed debug information, including the request ID, will be logged (default: false)

Appendix

  • The connector communicates with the SFMC v2 server/instance endpoint via HTTPS.
  • The HTTPS and SSL/TLS encryption are enforced by SFMC v2 servers and are checked by our connector before processing.

Important Note

  • This is a known limitation when working with Salesforce Marketing Cloud (SFMC), particularly in scenarios involving large-scale data retrieval from Data Extensions via SOAP API. Due to SFMC’s multi-tenancy architecture, there are cases where the data cursor may be lost mid-process, resulting in incomplete or inconsistent responses. This behavior has been observed during bulk operations and is currently considered a limitation of the SOAP API.