# SAP Marketing Cloud Import Integration SAP Marketing Cloud (previously Hybris Marketing) is a marketing solution that provides real-time context-based data about individual customers and anonymous visitors by unifying user data into a centralized hub. This allows brands to deliver consistent, contextual, and relevant experiences throughout a customer journey, regardless of the marketing channel or device. - Data Management: provides you with a 360 view of people interacting with your brand, enabling you to target them within the right context, in real-time. - Recommendation: delivers timely and highly relevant recommendations to your customers, helping you translate interest into conversion. - Segmentation: offers high-performing audience segmentation in real-time, enabling you to personalize campaigns across multiple channels. ## Prerequisites - Basic Knowledge of Treasure Data - Communication user ## About Incremental Data Loading - When incremental loading is enabled, the query issued to SAP Marketing Cloud contains the $filter statement. The $filter queries data for desired criteria - $filter is generated based on the filter_column, start_time, and end_time configurations. - The first value received will be kept as a reference for the next job filter. The next job $filter excludes previous job data and fetches new data only. - The process repeats for subsequence executions. ![](/assets/image2021-4-6_18-43-24.86d03abace4ca184c72b6857a6cc454f40bca56d8884edae922267e2da2e50bd.01d5f7cb.png) - If the end_timevalue is empty when incremental loading is enabled, it will automatically be set to the time job is executed. - The filter_column should satisfy the following conditions in metadata: - Contain Type Edm.DateTimeOffset or Edm.DateTime - Contain Nullable="false" - Does not contain sap:sortable="false" - Does not contain sap:filterable="false" - Incremental loading only supports Timestamp columns(Edm.DateTimeOffset and Edm.DateTime). - `All record containing empty value for filter_column field will be ignored.` ## Obtaining Communication User - The Communication User is defined in the SAP Marketing Cloud system (for example, INTEGRATION_TREASURE_DATA is the username, and the password is xxxx). The username and password here will be used as basic authentication to get x-csrf-token. ![](/assets/e55bc95f-dfd8-45e9-af3a-ff9ec6845c48.5d1e50463268a02e6b56ecd4559337e8ad070b048adf3e0f994c0449bf1f965f.01d5f7cb.png) - The Communication System is created and set up for this Communication User. `Learn more about SAP's Communication System setup.` ![](/assets/6835ee0a-a724-490c-9556-c0f752f7ad40.b00037b436aa2b72a9733f50de6411bbcd48e0957f2df5e49a2aa6117f4563a3.01d5f7cb.png) - Learn about setting up communication with [Other Systems for SAP Marketing Cloud](https://www.sap.com/cxworks/article/2589632510/how_to_set_up_communication_to_other_systems_for_sap_marketing_cloud). ## Use the TD Console to Create Your Connection ### Create a New Connection In Treasure Data, you must create and configure the data connection prior to running your query. As part of the data connection, you provide authentication to access the integration. 1. Open **TD Console**. 2. Navigate to **Integrations Hub** >  **Catalog**. 3. Search for and select **SAP Marketing Cloud**. ![](/assets/image2022-7-21_4-48-16.aad25859a6f44036debcad92a3948b56c07906718cae97397724e24403da2888.01d5f7cb.png) 4. Select Create Authentication. ![](/assets/image2022-7-21_5-11-5.1511d3671ddc0effe38ab473541ce573bc06e8cadcc78db89b2c4eeafa26b3d3.01d5f7cb.png) 1. Input Authentication data: 2. **Username**: Your SAP Marketing Cloud communication username 3. **Password**: Your SAP Marketing Cloud communication user's password 4. **Tenant ID**: Your SAP Marketing Cloud tenant id ![](/assets/image2022-7-21_5-12-0.f1f046ae02457ce5615b5871d68336069a0651061b59733a3b3240b0f43bfe3b.01d5f7cb.png) 5. Click **Continue**. 6. Input the name for this authentication. ![](/assets/image2022-7-21_4-50-30.c2e32f45d0a1daa2a0f463eed8382b4153bdee193d01e06f25ab8dfe6d944e82.01d5f7cb.png) 7. Click **Done**. ### Transfer Your Data to Treasure Data After creating the authenticated connection, you are automatically taken to Authentications. 1. Search for the connection you created. 2. Select New Source. 3. Type a name for your Source in the Data Transfer field.![](/assets/image2022-7-21_4-52-41.7bc1c4f1c0ed09c214e70ec7dba21ec2f1911630888261e94212debef5b39369.01d5f7cb.png) 4. Select **Next**; the Source Table dialog opens.![](/assets/image2022-7-21_4-54-12.c4365d12e371162a89725c66f8ad19d758c4ffe46c40b76a151fdd6db96c74a8.01d5f7cb.png) 5. Edit the following parameters. | **Configuration Name** | **Type** | Description | | --- | --- | --- | | Service Name | String | Target SAP Marketing Cloud service name | | API Version | String | The version of service you would like to use | | Entity Name | String | The entity from which you would like to ingest data from | | Incremental | Boolean | When run repeatedly, attempt to only import new data since the last import | | Filter Column | String | DateTime/DateTimeOffset column for incremental load or filtering (Case sensitive) | | Start Time | DateTime | Import data since this time | | End Time | DateTime | Import data until this time | 1. Select **Next,** The Data Settings page can be modified for your needs, or you can skip the page.![](/assets/image2022-7-21_5-0-6.c00c9b45efdfb34e4e83455b16b6c306d987ea8fd5d927ed8f6467ca7c687ee8.01d5f7cb.png) 2. Optionally, edit the following parameters: | Parameter | Description | | --- | --- | | Batch Size | Number of records to ingest per API call | | Retry Limit | Maximum retry times for each API call | | Initial retry time wait in millis | Wait time for the first retry (in milliseconds) | | Max retry wait in mills | Maximum wait time for an API call before it gives up | 1. Click **Next,** Data Preview dialog opens 2. Click Generate Preview to preview data or **Skip this step** to move to the next page. ![](/assets/image2022-7-21_5-1-45.8428dadf3dd46a8e198aaade8438e971d2e91c1d2bc3c4e7b67892e327835730.01d5f7cb.png) 3. Click **Next,** Data Placement dialog opens. ![](/assets/image2022-7-21_5-7-14.b6e17c49ce3d400ca08000a0c0bca2e845d3355d219d5d43fdd2e81daa9a3cc2.01d5f7cb.png) 4. Click **Create & Run Now** or **Create**. ## Import via Workflow You can import data from MS Dynamics 365 Sale by using td_load>: operator of workflow. If you have already created a SOURCE, you can run it. 1. Identify your source. 2. To obtain a unique ID, open the Source list and then filter bySAP Marketing Cloud. 3. Open the menu and select Copy Unique ID.![](/assets/image2021-10-12_12-26-58.09d9b84b0f1f752c7c95b0bc1c2d8e8b7302e5b91c6a3cb5f01309dadf53a604.01d5f7cb.png) 4. Define a workflow task using td_load> operator. ```yaml +load: td_load>: unique_id_of_your_source database: ${td.dest_db} Table: ${td.dest_table} ``` 1. Run a workflow.