# Salesforce Pardot Import Integration Salesforce Pardot B2B is a marketing automation tool by Salesforce designed for organizations that primarily focus on business-to-business (B2B) sales and marketing automation. This email marketing system offers automated support for the longer timespan and multi-step decisions associated with B2B sales and helps marketers create more leads, generate more pipelines, and empower sales to close more deals. The Salesforce Pardot import integration automates the end-to-end solution for our customers, which is ingesting data from Pardot into the Treasure Data database and activating a custom segment back to Pardot. ## Prerequisites - Basic Knowledge of Treasure Data. - Basic knowledge of Salesforce Pardot. - A working Salesforce Pardot account. - Your Business Unit ID. - You have the ability to create your own Salesforce Pardot connected app, or you have permission to grant access to the Treasure Data app to access your Pardot data. ## Requirements and Limitations - The imported values for timestamp columns are saved as string types in the Treasure Data database; the timezone is not available. - Use Export API for importing large amounts of data and does not support incremental loading. ## Static IP Address of Treasure Data Integration If your security policy requires IP whitelisting, you must add Treasure Data's IP addresses to your allowlist to ensure a successful connection. Please find the complete list of static IP addresses, organized by region, at the following link: [https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/](https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/) ## Obtain the Pardot Business Unit ID Follows steps in the [Pardot Export document](/int/salesforce-pardot-export-integration) to obtain the Business Unit ID. ## Import from Salesforce Pardot via TD Console ### Create Authentication Follows steps in the [Salesforce Pardot Export document](/int/salesforce-pardot-export-integration) to create an authentication. ### Create a Source 1. Open TD Console. 2. Navigate to Integrations Hub > Authentications. 3. Locate your new authentication and select New Source. ### Create a Connection Complete the following table for the connection. | Parameter | Description | | --- | --- | | Data Transfer Name | You can define the name of your transfer. | | Authentication | The authentication name that is used for a transfer. | 1. Type a source name in the Data Transfer Name field. 2. Select Next. The Create Source page displays with the **Source Table** tab selected. ### Identify a Source Table ![](/assets/screen-shot-2022-05-05-at-14.09.50.c032fb00dd8b4df04b7749b36f460d9be5a6b1fabaa37ba0e40146f815965a09.193b36ba.png) | Parameter | Description | | --- | --- | | Data Object | Pardot Object to import supported objects: - CAMPAIGN - FORM - LIST - LIST_MEMBERSHIP - OPPORTUNITY - PROSPECT - PROSPECT_ACCOUNT - VISITOR - VISITOR_ACTIVITY - CUSTOM_FIELD - CUSTOM_REDIRECT - EMAIL_CLICK - USER - VISIT - TAG - TAG_OBJECT - DYNAMIC_CONTENT | | Deleted? | Request Objects that were deleted. If you use Export API it is Prospects deleted if filter by PROSPECT_UPDATED_AT | | Use Export API | Use Export API to import data. When you have a large number of data to import, Export API is more efficient. Additionally, Export API can help you avoid meeting the API rate limit to your account. | | Filter by | Filter the data by CREATED_AT, UPDATE_AT, or PROSPECT_UPDATED_AT. The PROSPECT_UPDATED_AT is supported by PROSPECT_ACCOUNT and VISITOR Data Object in Export API mode only. | | Visitor IDs | Comma-separated Visitor IDs (no spaces). This field available for Visit Object only | | Prospect IDs | Comma-separated Prospect IDs (no spaces). This field available for VISIT and VISITOR Object only | | Visit IDs | Comma-separated Prospect IDs (no spaces). This field available for Visit Object only | | Start Time | Import data since this start time. The format must match: "yyyy-MM-dd HH:mm:ss". If not specified, data will be imported for one year to the specified End Time for Export API mode. | | End Time | Import data to this time. The format must match: "yyyy-MM-dd HH:mm:ss". If not specified, data will be imported for one year from the specified Start Time for Export API mode. | | Incremental Loading | Only import new data from the last import. This option is not available when Export API mode is used. | Select **Next**. ### Config the Data Settings ![](/assets/data-settings.788684b2de1a6ff5a40098ee45809f0935f43d04d12fecf68784c0c88f6e7e5b.193b36ba.png) The Data Settings allows you to fine-tune the HTTP request to Salesforce Pardot. Update your designed config settings and select **Next.** | Parameter | Description | | --- | --- | | Extra Columns (Optional) | Comma-separated list of columns name. If API response contains data, it saves the column as string. This field allows you import data for columns that's not specified in Pardot document, but the data is present when requested. | | Extra Request Params | Extra Request Parameters send to Pardot server. For example, you want to import List Memberships with specified LIST ID = 370707412, set the Name = list_id, and Value = 370707412 Note: This setting is not available when using Export API. | | Max retry count per API call | Max retry count per API call | | Initial retry interval per API call | Initial retry interval per API call in seconds | | Max retry interval per API call | Max retry interval per API call in seconds | | HTTP Connection Timeout | Set the HTTP connection timeout in seconds | ### Data Preview You can see a [preview](/products/customer-data-platform/integration-hub/batch/import/previewing-your-source-data) of your data before running the import by selecting Generate Preview. Data preview is optional and you can safely skip to the next page of the dialog if you choose to. 1. Select **Next**. The Data Preview page opens. 2. If you want to preview your data, select **Generate Preview**. 3. Verify the data. ### Data Placement For data placement, select the target database and table where you want your data placed and indicate how often the import should run. 1. Select **Next.** Under Storage, you will create a new or select an existing database and create a new or select an existing table for where you want to place the imported data. 2. Select a **Database** > **Select an existing** or **Create New Database**. 3. Optionally, type a database name. 4. Select a **Table**> **Select an existing** or **Create New Table**. 5. Optionally, type a table name. 6. Choose the method for importing the data. - **Append** (default)-Data import results are appended to the table. If the table does not exist, it will be created. - **Always Replace**-Replaces the entire content of an existing table with the result output of the query. If the table does not exist, a new table is created. - **Replace on New Data**-Only replace the entire content of an existing table with the result output when there is new data. 7. Select the **Timestamp-based Partition Key** column. If you want to set a different partition key seed than the default key, you can specify the long or timestamp column as the partitioning time. As a default time column, it uses upload_time with the add_time filter. 8. Select the **Timezone** for your data storage. 9. Under **Schedule**, you can choose when and how often you want to run this query. #### Run once 1. Select **Off**. 2. Select **Scheduling Timezone**. 3. Select **Create & Run Now**. #### Repeat Regularly 1. Select **On**. 2. Select the **Schedule**. The UI provides these four options: *@hourly*, *@daily* and *@monthly* or custom *cron*. 3. You can also select **Delay Transfer** and add a delay of execution time. 4. Select **Scheduling Timezone**. 5. Select **Create & Run Now**. After your transfer has run, you can see the results of your transfer in **Data Workbench** > **Databases.** ## Import from Salesforce Pardot via Workflow You can import data from Salesforce Pardot by using td_load>: operator of workflow. If you have already created a SOURCE, you can run it; if you don't want to create a SOURCE, you can import it using a yml file. ### Using a Source You can use an existing source to set up your workflow. You can use the Treasure Data Connected app if you don't have permission to create your custom Connected app. 1. Identify your source. 2. To obtain a unique ID, open the Source list and then filter by Salesforce Pardot. 3. Open the menu and select Copy Unique ID. ![](/assets/image2021-10-12_12-26-58.09d9b84b0f1f752c7c95b0bc1c2d8e8b7302e5b91c6a3cb5f01309dadf53a604.193b36ba.png) 1. 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. ### Using a Yaml file You have full control of the config with Yaml config file. 1. Identify your Yaml file. If you need to create the Yaml file, review [Amazon S3 Import Integration Using CLI](/int/amazon-s3-import-integration-v2#AmazonS3ImportIntegrationv2-UsingtheCLItoConfiguretheConnector) as a reference. 2. Define a workflow task using td_load> operator. ```yaml +load: td_load>: config/daily_load.yml database: ${td.dest_db} table: ${td.dest_table} ``` 1. Run a workflow. See the [CLI Parameter Reference](#parameters-reference). ### Sample Workflow Code Visit [Treasure Boxes](https://github.com/treasure-data/treasure-boxes/tree/master/td_load/s3) for sample workflow code. ## Import from Salesforce Pardotvia CLI (Toolbelt) Before setting up the connector, install the most current [TD Toolbelt](https://toolbelt.treasuredata.com/). ### Create Configuration File (load.yml) The following is an AWS example to prepare a seed.yml file. Replace the code with the correct code for your product. ```yaml in: type: salesforce_pardot client_id: xxxx client_secret: yyyy refresh_token: zzzz data_object: prospect business_unit: 0Uv4W00000111111 filter_by: 'created_at' incremental: true # use_export_api: true start_time: "2020-12-13 03:20:00" end_time: "2021-12-20 03:30:00" out: mode: append ``` ### Parameters Reference | Name | Description | Value | Default Value | Required | | --- | --- | --- | --- | --- | | type | The connector type. | salesforce_pardot | | yes | | client_id | The connected app consumer key. | | | yes | | client_secret | The connected app consumer secret. | | | yes | | refresh_token | The refresh token after completing the steps described in [Using Your Custom Connected App](/int/salesforce-pardot-export-integration#h2__1765871400). | | | yes | | business_unit | Your Salesforce Pardot Business unit. See [Obtain the Pardot Business Unit ID](/int/salesforce-pardot-export-integration#h1__1031407665). | | | yes | | data_object | Pardot Object to import, supported objects: - CAMPAIGN - FORM - LIST - LIST_MEMBERSHIP - OPPORTUNITY - PROSPECT - PROSPECT_ACCOUNT - VISITOR - VISITOR_ACTIVITY - CUSTOM_FIELD - CUSTOM_REDIRECT - EMAIL_CLICK - USER - VISIT - TAG - TAG_OBJECT - DYNAMIC_CONTENT | | | yes | | use_export_api | Use Export API to import data. When you have a large number of data to import, Export API is more efficient. | | false | no | | deleted | Request Objects that were deleted. If you use Export API it is Prospects deleted if filter by PROSPECT_UPDATED_AT | | no specified | | | filter_by | Filter the data by CREATED_AT, UPDATE_AT, or PROSPECT_UPDATED_AT. Note, the PROSPECT_UPDATED_AT is supported by PROSPECT_ACCOUNT and VISITOR Data Object in Export API mode only. | | | no | | start_time | Import data since this time, the format must match: "yyyy-MM-dd HH:mm:ss". If not specified, data will be imported for one year to the specified End Time for Export API mode. | | | no | | end_time | Import data to this time, the format must match: "yyyy-MM-dd HH:mm:ss". If not specified, data will be imported for one year from the specified Start Time for Export API mode. | | | no | | visitor_ids | Comma-separated Visitor IDs (no spaces). This field available for Visit Object only | | | no | | prospect_ids | Comma-separated Prospect IDs (no spaces). This field available for Visit Object only | | | no | | visit_ids | Comma-separated Prospect IDs (no spaces). This field available for Visit Object only | | | no | | incremental | Only import new data from the last import. This option is not available when Export API mode is used. | | false | no | | extra_columns | Comma-separated list of columns name. If API response contains data, it saves the column as string. This field allows you import data for columns that's not specified in Pardot document, but the data is present when requested. | | | | | extra_request_params | Extra Request Parameters send to Pardot server. For example, you want to import List Memberships with specified list_id = LA00003 set the value as `- {"name": "list_id", "value": "LA00003"}` Note: This setting is not available when using Export API. | | | no | | maximum_retries | The maximum number of retries when the request failed. | | 8 | no | | initial_retry_wait | The initial amount of time before the first retry in seconds. | | 120 | no | | maximum_retry_wait | The maximum amount of time to wait for a retry in seconds. | | 300 | no | | connection_timeout | The HTTP connection time out for a request to Pardot in seconds. | | 300 | no | To preview the data, use the *td connector:preview* command. ``` $ td connector:preview load.yml +-------+---------+----------+---------------------+ | id | company | customer | created_at | +-------+---------+----------+---------------------+ | 11200 | AA Inc. | David | 2015-03-31 06:12:37 | | 20313 | BB Imc. | Tom | 2015-04-01 01:00:07 | | 32132 | CC Inc. | Fernando | 2015-04-01 10:33:41 | | 40133 | DD Inc. | Cesar | 2015-04-02 05:12:32 | | 93133 | EE Inc. | Jake | 2015-04-02 14:11:13 | +-------+---------+----------+---------------------+ ``` ### Execute Load Job Submit the load job. It might take a couple of hours depending on the size of the data. Be sure to specify the Treasure Data database and table where the data should be stored. Treasure Data also recommends specifying *--time-column* option because Treasure Data’s storage is partitioned by time (see [data partitioning](https://docs.treasuredata.com/smart/project-product-documentation/data-partitioning-in-treasure-data)). If this option is not provided, the data connector chooses the first *long* or *timestamp* column as the partitioning time. The type of the column specified by *--time-column* must be either of *long* and *timestamp* type. If your data doesn’t have a time column, you can add a time column by using *add_time* filter option. For more details see [add_time filter plugin](https://docs.treasuredata.com/smart/project-product-documentation/add_time-filter-function). ``` $ td connector:issue load.yml --database td_sample_db --table td_sample_table --time-column created_at ``` The connector:issue command assumes that you have already created a *database(td_sample_db)*and a *table(td_sample_table)*. If the database or the table does not exist in TD, this command fails. Create the database and table manually or use *--auto-create-table* option with *td connector:issue* command to auto-create the database and table. ``` $ td connector:issue load.yml --database td_sample_db --table td_sample_table --time-column created_at --auto-create-table ``` The data connector does not sort records on the server-side. To use time-based partitioning effectively, sort records in files beforehand. If you have a field called *time*, you don’t have to specify the *--time-column* option. ``` $ td connector:issue load.yml --database td_sample_db --table td_sample_table ``` ### Scheduling Executions A new schedule can be created using the *td connector:create* command. ``` $ td connector:create daily_import "10 0 * * *" td_sample_db td_sample_table load.yml ``` Treasure Data also recommends that you specify the *--time-column* option, because Treasure Data’s storage is partitioned by time (see also [data partitioning](https://docs.treasuredata.com/smart/project-product-documentation/data-partitioning-in-treasure-data)). ``` $ td connector:create daily_import "10 0 * * *" td_sample_db td_sample_table load.yml --time-column created_at ``` The `cron` parameter also accepts three special options: `@hourly`, `@daily`, and `@monthly`. By default, the schedule is set up in the UTC timezone. You can set the schedule in a timezone using -t or --timezone option. `--timezone` option supports only extended timezone formats like 'Asia/Tokyo', 'America/Los_Angeles', etc. Timezone abbreviations like PST, CST are *not* supported and might lead to unexpected schedules. ## FAQs for the Salesforce Pardot Integration ### How can I schedule an incremental import for a large data set? As recommended, when importing a large dataset from Pardot you should use the Export API. However, export API doesn't support incremental import. To solve this issue: - Use Export API to import to a recent date. For example, today by specifying the **Filter By** and **End Time** will import all data to the End Time value. - Modify the job config, uncheck the Use Export API checkbox, set the **Start Time** equals the End Time from the previous execution, and set enable the **Incremental Loading.**