# Marketo Import Integration [Learn more about Marketo Export Integration](/int/marketo-export-integration). You can import Marketo data into Treasure Data. Then, in Treasure Data, you can integrate the data with your other data sources. You can also import using the CLI ( see [Marketo Import Connection Using CLI](/int/marketo-import-connection-using-cli)). Bulk extracts source are imported using Marketo Bulk Extract API. For sample workflows for importing Marketo data, see [Treasure Boxes](https://github.com/treasure-data/treasure-boxes/tree/master/td_load/marketo). ## Prerequisites, Limitations, and Requirements - Basic knowledge of Treasure Data. - There is a daily quota of 500MB Bulk Extract per day. If you reach the limit, we recommend that you reduce the import date range, or contact Marketo account manager and pay for additional space. - Marketo will retain high-volume activity data for 90 days past the activity date and all other activity data for at least 25 months past the activity date. You can view Marketo's [Activities Data Retention Policy document](http://info.marketo.com/uCb200AYbv0m6M02g5rHG60) for more details. ## 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 Marketo Munchkin Account Information Access to your API-enabled account is required before you can access the API. The Munchkin Account ID can be retrieved from the Marketo Admin page. To enable and create a new account for API access: 1. Create an [API Only User.](http://docs.marketo.com/display/public/DOCS/Create+an+API+Only+User) 2. Create an [API Only User Role](http://docs.marketo.com/display/public/DOCS/Create+an+API+Only+User+Role). 3. Get the Custom Object API name. ![](/assets/image-20191021-162634.68baf1e088bfdce371ad8ae676cd179cb75d9070ee469184b9f15939784f991a.2ab18ed8.png) 4. Get the Custom Object field name. ![](/assets/image-20191021-162625.a58bb0835146cffed821ad9b5d9bc5b2d6a98c5499fb93f2e0a514ffbd71272f.2ab18ed8.png) ## Import from Marketo via TD Console ### Create Authentication Your first step is to create a new authentication with a set of credentials. 1. Select **Integrations Hub**. 2. Select **Catalog**. ![](/assets/integrationshub-catalog2.e33c0a4c7d81c40cc83dd056c2143b97b1406220e213cab14ef349d69412ffef.7705d4c2.png) 3. Search for your Integration in the Catalog; hover your mouse over the icon and select **Create Authentication**. ![](/assets/marketoimportexport.b7ca6a82a518ad841c1b95328091c8b6bf21b7ba895cbc69d790d06f7c415fd3.2ab18ed8.png) 4. Ensure that the **Credentials** tab is selected and then enter credential information for the integration. ![](/assets/marketonewauth.10cabd055fb69ad5f6d83c6abf5b6631f5d91386f30130c23508fe94979cbb88.7705d4c2.png) **New Authentication Fields** | Parameter | Description | | --- | --- | | Marketo Account ID (required) | This is your Marketo Service/Munchkin ID. | | Marketo Client ID (required) | This is a service-specific client ID. | | Marketo Client Secret (required) | This is a service specific client secret. | 1. Select **Continue**. 2. Enter a name for your authentication and select **Done**. ### Create a Source 1. Open TD Console. 2. Navigate to **Integrations Hub** > **Authentications**. 3. Locate your new authentication and select **New Source**. The Create Source modal opens. #### Create a Connection 1. Type a name in the Data Transfer field. ![](/assets/image-20200615-061442.fb27a68e873df862b2628695eb1d11179d5544effeed13df33425e5f5bd75537.2ab18ed8.png) 2. Select **Next**. #### Source Table 1. From the Source drop-down menu, choose one of the following sources: - Leads - Activities - Campaigns - Leads by Static List - Leads by Program - Programs - Custom Object - Program Members The values to enter differ based on your choice of source: **Leads** ![](/assets/leads.0ba6526f5b40235f317e25fb8e23aac15ca4f339bebaffb72b6d045e2fd387f7.2ab18ed8.png) **Activities** ![](/assets/activities.433e1e58e5c352159c58263a51b2ce6919f513bf131abc65a168709e4a163e4a.2ab18ed8.png) **Campaigns** ![](/assets/campaigns.23695f79808a5d8f4fdcd62e1e0f6ef0bbcb774dc8b30121bd1ef0af65e73518.2ab18ed8.png) **Leads by Static List** ![](/assets/leadsstaticlist.305cc0183a9fff987b3459142ca42150d796ac64c447c90885c2679c5b79c624.2ab18ed8.png) **Leads by Program** ![](/assets/leadsprogram.e2f9f7a05608814b6711663e526e33cbfc6b3a8ff42336a903649d8206bb25e0.2ab18ed8.png) **Programs** ![](/assets/programs.312d75a56056002a26c731d7b4d84892f56c2fc88586e8db6e7c9d5e2fb147df.2ab18ed8.png) **Custom Object** ![](/assets/customobject.d917e414b9d8b41844695ea677582c1214462f11fea1d1d9445186f1bf8921aa.2ab18ed8.png) **Program Members** ![](/assets/programmembers.c2ba53a121ec27b4cae826b52e81ab4a19b61b10e4cddb49f62a66455154e3fe.2ab18ed8.png) | Parameter | Description | | --- | --- | | Incremental | Bulk extract sources support the incremental import feature through the createdAt filter. The connector calculates the next from_date when running in an incremental mode based on the previous filter. Example: - 1st run from_date: 2018-01-01 to_date: 2018-01-11(generated by plugin) fetch_days: 10 - 2nd run from_date: 2018-01-11 to_date: 2018-01-21 fetch_days: 10Limitation: – Bulk extract source preview shows only mock data. | | updateAt | updatedAt is used when you want to retrieve data based on the update date for incremental loading. updatedAt without incremental will allow you to get the updated leads within a specific amount of time | | From Date | Data that has a `createdAt` or `updatedAt` filter after the specified date. | | Fetch Days | The `To date` is calculated using `From day + Fetch days` | | Escape Character | The Marketo CSV file escape character | | Quote Character | The Marketo CSV file quote character | | Activity Type IDs | Integer values correspond to the desired activity types. | | List IDs | Retrieves person records that are members of the given static list. Results include the column listId that contains the lead list ID. Optional. Comma separated List IDs, or leave the field blank to import all lists. | | Program IDs | Optional. Comma separated program IDs. Or leave the field blank to import all programs. | | Query By | Query Programs by Tag Type or Date Range. Or, leave blank to import all programs. With Query By: Tag Type, Incremental import is not supported and therefore is omitted. With Query By Date Range and Incremental import is selected, the next run Earliest Updated At and Latest Updated At will be calculated based on previous range, example:- 1st run: Earliest Updated At = 02/01/2018 10:00, Latest Updated At = 02/10/2018 10:00- 2nd run: Earliest Updated At = 02/10/2018 10:01, Latest Updated At = 02/20/2018 10:01 | | API Name | The API name of the custom object | | Fields | Optional. Comma-separated API name of fields of the custom object. | | Filter Type | Comma-separated list of fields API name needs to return.  If unset marketoGuid, dedupe Fields, updatedAt, createdAt will be returnedInput filter values as text (comma separated), or by range (From Value to To Value). | | Input as Text | Input filter values as text (comma separated), or by range (From Value to To Value). | | Filter Values | Comma-separated list of field values to match. | | From Value | Filter start value. Only supports integers. | | To Value | Filter end value (Optional). Only supports integers. Only records with a value greater than "From Value" will be returned if not set. The job will stop if no record is found in 300 consecutive values. | | Program IDs | Optional. Comma-separated program IDs, or leave the field blank to import members of all programs. | 1. Select **Next**. #### Data Settings 1. Optionally, edit the data settings or skip this page. ![](/assets/image-20200615-145146.59b6dc2b4dcb55028d836a33e4b88250a523414fb660c928ff4d86a40f69a05d.2ab18ed8.png) | **Parameters** | **Description** | | --- | --- | | LEAD INCLUDED FIELDS | Add a list of Lead fields to be included in data import, which only affects the Lead family target | | Interval limit in milliseconds | Time to wait for the next call if the request reaches Marketo concurrent limit | | Maximum retries | Maximum times to retry Marketo request when an error occurs. | | Batch size | Marketo REST API Batch size (default 300). | | Max return | Max records to return in a single request. The program endpoint uses offset for paging (default 200). | | Bulk job timeout in seconds | Total time wait for bulk extract before failing the job | | Bulk job polling interval in seconds | Interval to poll job status | | Read timeout in milliseconds | Time to wait for Marketo's response | ### 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.**