You can create and use a connector to write 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.
- Basic knowledge of Treasure Data, including the toolbelt.
- A Marketo Account with API access enable (done via Marketo Console).
Step 1: 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
Step 2: Configure to output results to Marketo connection
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:
Step 3: 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', 'email@example.com', 'Marketo Dummy Lead - DO NOT USE'), ('x1b065f5-1222-4a14-b151-379d49ec39e3', 'Janes', 'Doe', 'firstname.lastname@example.org', 'Marketo Dummy Lead - DO NOT USE'), ('p1b065f5-1222-4a14-b151-379d49ec39e3', 'Tony', 'Doe', 'email@example.com', 'Marketo Dummy Lead - DO NOT USE'), ('o1b065f5-1222-4a14-b151-379d49ec39e3', 'Bill', 'Adam', 'firstname.lastname@example.org', 'Marketo Dummy Lead - DO NOT USE'), ('t1b065f5-1222-4a14-b151-379d49ec39e3', 'Dan', 'Steve', 'email@example.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
The query should complete in a few seconds. After that, check the Marketo Console for your new leads:
Appendix A: 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)
Appendix B: 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
1.Create an API Only User here.
2.Create an API Only User Role here.
3.Enable the Advanced List Import Permission on a Role here.
4.Create a Custom Service for Use with ReST API here.
5.Check Endpoint for Rest API on “Web Service” menu where you can find a client id and a client secret for using API.
Appendix C: Some useful information about preparing data for Marketo leads
- Error code
- Partion Name
- Data Type for Marketo Lead fields
- Standard Lead fields (available from API access)