You can create and use a connector to write Arm Treasure Data job results directly to your Marketo account records. The TD query job results add users to Marketo Target lists.
You can use this same connector to import Marketo data into Treasure Data. See import from Marketo.
Prerequisites
- Basic knowledge of Treasure Data, including the toolbelt.
- A Marketo Account with API access enable (done via Marketo Console).
Create a new connection
Go to Treasure Data Connections. Locate and select Marketo.

The dialog opens.

Complete the new connection information, providing your Marketo credential. Refer to Appendix B for information on where to find your credential information.
- Marketo Account ID (required): This is your Marketo Service/Munchkin ID.
- Marketo Client ID (required): This is service specific client id.
- Marketo Client Secret (required): This is service specific client secret.
You can give a name to your newly created connection and save it for later use

Configure to output results to Marketo connection
Check to Output results
at top of your query editor and select your Marketo connection.
There are several parameter fields to complete:
- Marketo Target List ID : ID of the list where the new leads are imported into.
- Important note: The list must be from an existing list, otherwise the new leads will go into the main Marketo database
- Headers for importing data: Specify headers here or in the result output query as column alias
- Marketo Partition Name: Name of the partition the new leads will belong to (optional)
- Lookup Field: The value in this field is bound to this data set and can be used to lookup or de-dup the data set
- Retry limit (optional, default
6
): Number of retries before the connector stops trying to connect and send data out - Initial intervals in milliseconds between retries (optional, default
10000
): Interval to retry if a recoverable error happens (in millisecond). - Maximum intervals in milliseconds between retries (optional, default to
32000
) : Maximum time in milliseconds between retrying attempts.
A sample configuration:
Where the list ID can be found on Marketo Console:
Write the Query to populate a leads list
On Treasure Data console, run the following query with Output results
into a connection of Marketo. The query does not match any real users and is for demonstration purposes only. (See Appendix A for more details of column naming):
SELECT td_global_id as tdglobalid, firstname, lastname, email, company FROM ( VALUES ('b1b065f5-1222-4a14-b151-379d49ec39e3', 'John', 'Doe', 'name+test1@treasure-data.com', 'Marketo Dummy Lead - DO NOT USE'), ('x1b065f5-1222-4a14-b151-379d49ec39e3', 'Janes', 'Doe', 'name+test2@treasure-data.com', 'Marketo Dummy Lead - DO NOT USE'), ('p1b065f5-1222-4a14-b151-379d49ec39e3', 'Tony', 'Doe', 'name+test3@treasure-data.com', 'Marketo Dummy Lead - DO NOT USE'), ('o1b065f5-1222-4a14-b151-379d49ec39e3', 'Bill', 'Adam', 'name+test4@treasure-data.com', 'Marketo Dummy Lead - DO NOT USE'), ('t1b065f5-1222-4a14-b151-379d49ec39e3', 'Dan', 'Steve', 'name+test5@treasure-data.com', 'Marketo Dummy Lead - DO NOT USE') ) tbl ( td_global_id, firstname, lastname, email, company )
The demo query requires no source table (for the ease of testing out this feature), but you still must choose your database, so pick “sample_datasets” or any other arbitrary table.
If you don’t want to specify the data headers in the configuration, you can use aliases in your query to rename columns of your query result, for example:
SELECT an_email_column AS EMAIL, another_phone_column AS PHONE FROM your_table;
to create new dataset with headers of EMAIL,PHONE
- Note: column name is case-insensitive, for example, you can use either of
email
orEMAIL
.
The query should complete in a few seconds. After that, check the Marketo Console for your new leads:
Appendix
Marketo Leads Data
Output result data must follow Marketo data specifications described here.
For example, when the field is set up as Integer, the data Treasure Data sends to Marketo must be convertable to int ( 1001aa will not be a valid integer)
Munchkin Account Information
Access to your API-enabled account is required before you can upload the Marketo list. The Munchkin Account ID can be retrieved from the Marketo Admin page.
Steps to enable and create a new account for API access
- Create an API Only User here.
- Create an API Only User Role here.
- Enable the Advanced List Import Permission on a Role here.
- Create a Custom Service for Use with ReST API here.
- Check Endpoint for Rest API on “Web Service” menu where you can find a client id and a client secret for using API.
Some useful information about preparing data for Marketo leads
- Error code
- Partion Name
- FilterType/LookupField
- Data Type for Marketo Lead fields
- Standard Lead fields (available from API access)
Comments
0 comments
Please sign in to leave a comment.