# 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](/int/salesforce-marketing-cloud-v2-export-integration). To see sample workflows for importing Salesforce Marketing Cloud data, go to [Treasure Boxes](https://github.com/treasure-data/treasure-boxes/tree/master/td_load/sfmc). - [Prerequisites](/int/salesforce-marketing-cloud-import-integration-v2#h1_1644201065) - [Limitation](/int/salesforce-marketing-cloud-import-integration-v2#h1__1641228358) - [Create an Install Package in Salesforce Marketing Cloud](/int/salesforce-marketing-cloud-import-integration-v2#h1_1609842111) - [Create a Legacy Package](/int/salesforce-marketing-cloud-import-integration-v2#h2_20487344) - [How to Create Enhanced Functionality Package](/int/salesforce-marketing-cloud-import-integration-v2#h2__78391380) - [Use the TD Console to Create Your Connection](/int/salesforce-marketing-cloud-import-integration-v2#h1__76814271) - [Create a new connection](/int/salesforce-marketing-cloud-import-integration-v2#h2_1865553679) - [Create Legacy Package Integration](/int/salesforce-marketing-cloud-import-integration-v2#h3_404566245) - [Create Enhanced Package Integration](/int/salesforce-marketing-cloud-import-integration-v2#h3_775794262) - [Create a New Transfer](/int/salesforce-marketing-cloud-import-integration-v2#h2__2079243870) - [Available Targets](/int/salesforce-marketing-cloud-import-integration-v2#h2__11689321) - [Appendix](/int/salesforce-marketing-cloud-import-integration-v2#h1__1835053169) - [Important Note](/int/salesforce-marketing-cloud-import-integration-v2#h1__1087930188) # 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.](/int/migrating-salesforce-integrations) # 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.** ![](/assets/image-20191021-143027.5174041da2ba1262fecec3a342aa6bce3ceb41c6e042ee130fee39714531fa0d.3736ed4a.png) On the left side menu of the new screen, select **App** > **Installed Packages.** ![](/assets/image-20191021-143035.41e0d4d8f1ea21af5f24301890ee9d563ca509df392a555eaf7cf2d15c3e2ee8.3736ed4a.png) On the **Installed Packages** screen, select **New**. ![](/assets/image-20191021-143046.b09a9daa4819094f902ecbf155fd53b1395b41246cc32fab0b3679eaed16ff47.3736ed4a.png) On the **New Package Details** pop up, enter the **Name** and **Description.** Uncheck (deselect) thecheckbox **Create with enhanced functionality (recommended)** then select **Save.** ![](/assets/image-20191021-143110.21a4f99026cf4a84377caeac44d22b7948596e7085dd2185a583b1963bcbd21e.3736ed4a.png) On the **Package Details** screen, select **Add Component.** ![](/assets/image-20191021-143125.9056eea6e9f836acf964d84a39b39f0f73f38bd3e98e29bfd7c27ea1ebc0ef2c.3736ed4a.png) On the **Add Component** pop up, select **API Integration** then select **Next.** ![](/assets/image-20191021-143136.d8110597e97cf88b3b22c5067e518313b664c943d36e320bae3e86b7efdd0361.3736ed4a.png) 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** ![](/assets/image-20191021-143146.ea856636f504485b1834fdcfd6325c277d1d3b7bfb3057264ffab0ffdf50388e.3736ed4a.png) ![](/assets/image-20191021-143153.5ede65c100bc82b4ec6a9bcd9c8312f994ab63ce046adc712000b4acdfa386ee.3736ed4a.png) ![](/assets/image-20191021-143159.61b344fa688a50d3b3de2eb12a540320d5ce88637cd563154b3ed83e35d5f98a.3736ed4a.png) ![](/assets/image-20191021-143206.02630fe123bb6d8d149869821a6d5776714799f0fe6424af24257e9fa0788494.3736ed4a.png) 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. ![](/assets/image-20191021-143214.84f65b490fa7fa74752feef42ad33362b59470970466231d2fc9428511b1b22d.3736ed4a.png) ## 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**. ![](/assets/image-20191021-143224.62577fde4ad9cd668977dd89e9961331d90de14ab22b4a578703b271db0fc7cc.3736ed4a.png) 3. On the left side menu of the new screen, select **App** > **Installed Packages. ![](/assets/image-20191021-143237.4131d4caf822c7e03c802c62ef03fa714df6fa0a2f142a975cc992b831053fa4.3736ed4a.png)** 4. On the **Installed Packages** screen, select **New**. ![](/assets/image-20191021-143250.6846f4eec992528d69770c3f8ada141f0157169077f5d21fedaec4533c8100d4.3736ed4a.png) 5. On the **New Package Details** pop up, enter the **Name** and **Description** and selectthecheckbox **Create with enhanced functionality (recommended).** 6. Select **Save. ![](/assets/image-20191021-143301.054b962b05afe633a3f12a3ee89f47bb035c270d04401f1213c15cde749fbff9.3736ed4a.png)** 7. On the **Add Component** pop up, select **API Integration** then select **Next. ![](/assets/image-20191021-143313.390c9d70ef21b4c42eb286abd2bcdd58a383571e30fde1f1bd3bccbfbf3edef5.3736ed4a.png)** 8. On the Choose Your Integration Type screen, select Server-to-Server and then select **Next**. ![](/assets/image-20191021-143326.0fba178d5e0227f878beeda41a8580f3e7213e0c0c6adb4e044bbb7e01383bf3.3736ed4a.png) 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 Extensions**, **Read**for **Tracking Events** 4. Scroll to **HUB** section and select the **Read** checkbox on the **Campaign **![](/assets/image-20191021-143338.28cd4a8ef05485b695e6725234131d216aa5383ef1c85c5820d6a29d08f0a7a0.3736ed4a.png) ![](/assets/image-20191021-143348.357e5cbb69046045e99b02dee4dd8e6967103e34146405bc6bcd4fb2a92c4b75.3736ed4a.png) ![](/assets/image-20191021-143354.1f482fe60ddb0baba121886ec1c5771f65ec6a03f7551d809353ae07552fc1c1.3736ed4a.png) ![](/assets/image-20191021-143400.c723fe6e07dee083be3620aa6e6488fe5698c8f6c3ab5e70ac04396c40d17d7b.3736ed4a.png) 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. ![](/assets/image-20191021-143409.df5446402533546a4fb7feb70e376926bbf0d2d7f40549e50f6ebb742782b3ac.3736ed4a.png) # 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. ![](/assets/screen-shot-2021-11-30-at-08.39.55.1c14880189b26500d01e5f17c73ee11c8cfcef06d49512e5b95029dce3fabd3a.3736ed4a.png) ### 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](http://exacttargetapis.com)]. For more information: [https://help.salesforce.com/s/articleView?id=000356497](https://help.salesforce.com/s/articleView?id=000356497), [https://help.salesforce.com/s/articleView?id=000356498](https://help.salesforce.com/s/articleView?id=000356498) Select **Continue.** ![](/assets/screen-shot-2021-11-30-at-08.42.13.22519d16514d5bebc0d50bde7d45ea6f80ab2f9f5c878947043301e5c5bd4a1c.3736ed4a.png) Enter a **Name** for this integration and select **Done.** ![](/assets/image-20191021-143438.a3209495167dd05c79b1b6045fefe94660d4e1e2704721bf353c42b42862e12d.3736ed4a.png) ### 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](https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/rest-permissions-and-scopes.htm)**)**. Select **Continue.** ![](/assets/image-20191021-143459.8a9dec9f1a09ebbed8c2d6026b59ac8dbe2e58b84db80cb585ea330fef72329d.3736ed4a.png) Enter a **Name** for this integration and select **Done.** ![](/assets/image-20191021-143511.75979c784fcbd8db97c8212a7a3b1ae3f2f93950beb92d3c52edff4d221e1d07.3736ed4a.png) ## Create a New Transfer After creating the connection, you are automatically taken to **Sources**. Look for the connection you created and select **New Transfer**. ![](/assets/image-20191021-143520.62b4d4a4c1b3194ffe01dee2a43fcc755fec054b4f6361d9004dcf6673b44c8a.3736ed4a.png) The following dialog opens. Complete the details and select **Next**. ![](/assets/image-20191021-143529.a933ee0e85d9e153b13caf20ceb466ae66f141f69f574f19f7f47aec5980e467.3736ed4a.png) Next, you see a Preview of your data similar to the following dialog. To make changes, select **Advanced Settings** otherwise, select **Next**. ![](/assets/image-20191021-143539.53c9b99b42edb08e19207068cf9823b955577ea63074c428cbd29a7d409c6130.3736ed4a.png) From here, if you want to change some options such as skipping on errors or rate limits and connection timeout, select **Advanced Settings**: ![](/assets/screenshot-2023-03-10-at-15.47.49.d9bb86042fd07fcbed104e1f94de1ce7453ae1e50ca978e1321e8b4c5a0c4ecd.3736ed4a.png) Select the database and table where you want to transfer the data: ![](/assets/image-20191021-143738.46695acbf95696698f3c4fdbd715e39ced4ba0934ed785cebee312a194b5a60b.3736ed4a.png) Specify the schedule of the data transfer using the following dialog and select **Start Transfer**: ![](/assets/image-20191021-143749.b5563c71c5f954344925becc97e3f31d6a39647a0de89cdf30e999ff46a00e09.3736ed4a.png) 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 | **Target** | **Description** | | --- | --- | | Campaign | The e-mail campaign | | Contact | The contact list | | Data Extensions | The data extensions to satisfy the need for flexible data storage | | Email Events | The events associated with an email marketing send | | Email Events Only | The email events data | | Send | The 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) ![](/assets/screenshot-2025-04-15-at-09.06.22.c5d43f51ef864cbb9c235729fb49ff5faa127094088f0d043a3844b03f581689.3736ed4a.png) 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) ![](/assets/screenshot-2025-04-15-at-09.05.28.8694512b6fae213d0e3a334cd000a96a99fe8120decbb8cfc06cd7ebefab6d15.3736ed4a.png) # 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.