You can write job results from Treasure Data directly to The Trade Desk. In The Trade Desk, you can then use these Data Export in your ad campain.
- Basic knowledge of Treasure Data, including the TD Toolbelt
- An account in The Trade Desk.
- Authorized Treasure Data account access.
- Advertiser First-Party Data API by The Trade Desk Export connector
- What it is: A more permanent integration that syncs an advertiser’s customer database with The Trade Desk.
- How it’s used: Strategic, always-on use of first-party data as an asset. For example, continuously syncing loyalty program members into the platform so they can be used across many campaigns over time.
- Business value: Turns your customer base into a long-term strategic asset for advertising. Instead of campaign-by-campaign uploads, your data is always available to fuel audience creation and targeting.
- CRM Data Integration API by The Trade Desk CRM Data Export connector
- What it is: A way to upload specific customer lists (emails, phone numbers, etc.) into the platform to build a segment.
- How it’s used: Typically for campaign-specific or one-off use cases. For example, uploading a list of churned customers to exclude them from an upcoming campaign.
- Business value: Gives marketers the flexibility to act quickly — “I want to target or exclude this group right now.”
You can use the TD Console to configure your connection.
Go to Manage API Tokens/Keys and create a new token/keys or select existing tokens

From TD Console, select Integrations Hub.
Select Catalog.
Search for and select The Trade Desk CRM Data Output connector.

Select Create Authentication.
The New Authentication dialog opens.

Edit the CRM Data Token and advertiser ID you obtained from The Trade Desk, and select Continue.
Enter a name for the connection.

Select Done.
The Trade Desk output connector is created.
In this step, you create or reuse a query. In the query, you configure the data connection. In some cases, you must define the column mapping in the query.
Access the TD Console and navigate to Data Workbench > Queries.
Locate and select the the query that you want to use to export data.
Select Export Results located at top of your query editor.
The Choose Integration dialog displays.
Enter The Trade Desk connection name in the search box to filter and select your connection.
Specify the parameters:
Parameters:
- CRM Data Segment ID(optional): Your CRM Data Segment ID. Required if Segment Name is empty.
- Segment Name(optional): Your segment name. Required if CRM Data Segment ID is empty.
- Merge Mode (required): The way the newly uploaded personally identifiable information (PII) is to be merged with the existing data. One of Add, Replace. Default is Add
- PII Type (required): The type of personally identifiable data (PII) sent by the advertiser. Select from a drop down, see PII Types. Default is Email.
- Time-to-Live (TTL)(optional): Time-to-live in minutes for the anonymized identifiers generated by the mapping process. Default is 129.600 (90 days).
- Wait Until Finished (optional): Check to let the job execution wait until drop state move to final. Default is false (unchecked).
- Max Wait Time (optional): Max time until jobs finished in minutes. Default is 720 minutes (12 hours). Allow value range 0 - 1380 (23 hours).
- Skip invalid record(s) (optional): Check to skip invalid records and process all remaining. Default is true (checked)
| Pii Type | Description |
|---|---|
| PII sent as email addresses. | |
| EmailHashedUnifiedId2 | PII sent as normalized, SHA-256-hashed, base64-encoded email addresses, ready for conversion to UID2. |
| Phone | PII sent as phone numbers. |
| PhoneHashed | PII sent as normalized, SHA-256-hashed, base64-encoded phone number |
| UID2 | The raw UID2 value, also known as UID2. This value is case-sensitive. Raw UID2s are generated and managed using UID2 APIs. |
| UID2Token | The encrypted UID2 token, also known as an advertising token. This token is case-sensitive. Tokens are generated and managed using UID2 APIs. For details about UID2 APIs, see UID2 Endpoints. For details about UID2 tokens, see Raw IDs vs. Tokens. |
| EUID | The raw European Unified ID value, also known as EUID. This value is case-sensitive. EUID offers user transparency and privacy controls designed to meet market requirements in European regions with the same normalization and encoding of PII as UID2. |
| EUIDToken | The encrypted EUID token, also known as an advertising token. This token is case-sensitive. For details, see Unified IDs. |
| IDL | The 49-character or 70-character RampID (previously known as IdentityLink) |
| ID5 | The ID5 for the user. Data providers holding these IDs should engage with ID5 directly to obtain the necessary decryption keys. For details about ID5, see the ID5 site. IMPORTANT: The ID5 ID is supported only in Europe and must be in decrypted form. |
| NetID | The user's netID as a 70-character base64-encoded string. For details about netID, see the netID Developer Portal. IMPORTANT: This ID is supported only in Europe. |
| FirstId | The user's First-id, a first-party cookie typically set by publishers in France. For details about First-id, see the First-id site. IMPORTANT: This ID is supported only in Europe. |
| TDID | The Trade Desk 36-character GUID (including dashes) for this user. |
| DAID | The raw device ID for this user, sent in 36-character GUID format (including dashes). Use iOS IDFA or Android's AAID. |

- PII columns must not be empty.
- Timestamp_utc must not be empty. Column type can be string in datetime format or long for datetime in seconds.
From Treasure Data, run the following query with Output results into a connection for The Trade Desk:
Example Query
SELECT
PII,
timestamp_utc,
VALUE,
value_currency,
Country,
Region,
metro,
City,
OrderId,
td_1,
td_2,
td_3,
privacy_type,
is_applicable,
consent_string
FROM (
VALUES
('', '2025-08-11 03:25:25.675', 4.5, 'USD', 'US', 'Region', 56, 'City', 'order id', 'custom data 1', 'custom data 2', 'custom data 3', 'GPP', TRUE, 'consent string'),
('customer1@example.org', '2025-08-11 03:25:25.675', 4.5, 'USD', 'US', 'Region', 56, 'City', 'order id', 'custom data 1', 'custom data 2', 'custom data 3', 'GPP', TRUE, 'consent string'),
('customer2@example.org', NULL, 4.5, 'USD', 'US', 'Region', 56, 'City', 'order id', 'custom data 1', 'custom data 2', 'custom data 3', 'GPP', TRUE, 'consent string'),
('customer3@example.org', '2025-08-11 03:25:25.675', 4.5, 'USD', 'US', 'Region', 56, 'City', 'order id', 'custom data 1', 'custom data 2', 'custom data 3', 'GPP', FALSE, 'consent string')
) AS tbl (
PII,
timestamp_utc,
VALUE,
value_currency,
Country,
Region,
metro,
City,
OrderId,
td_1,
td_2,
td_3,
privacy_type,
is_applicable,
consent_string
);You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.
Treasure Data's scheduler feature supports periodic query execution to achieve high availability.
When two specifications provide conflicting schedule specifications, the specification requesting to execute more often is followed while the other schedule specification is ignored.
For example, if the cron schedule is '0 0 1 * 1', then the 'day of month' specification and 'day of week' are discordant because the former specification requires it to run every first day of each month at midnight (00:00), while the latter specification requires it to run every Monday at midnight (00:00). The latter specification is followed.
Navigate to Data Workbench > Queries
Create a new query or select an existing query.
Next to Schedule, select None.

In the drop-down, select one of the following schedule options:

Drop-down Value Description Custom cron... Review Custom cron... details. @daily (midnight) Run once a day at midnight (00:00 am) in the specified time zone. @hourly (:00) Run every hour at 00 minutes. None No schedule.

| Cron Value | Description |
|---|---|
0 * * * * | Run once an hour. |
0 0 * * * | Run once a day at midnight. |
0 0 1 * * | Run once a month at midnight on the morning of the first day of the month. |
| "" | Create a job that has no scheduled run time. |
* * * * *
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +---------- month (1 - 12)
| | +--------------- day of month (1 - 31)
| +-------------------- hour (0 - 23)
+------------------------- min (0 - 59)The following named entries can be used:
- Day of Week: sun, mon, tue, wed, thu, fri, sat.
- Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec.
A single space is required between each field. The values for each field can be composed of:
| Field Value | Example | Example Description |
|---|---|---|
| A single value, within the limits displayed above for each field. | ||
A wildcard '*' to indicate no restriction based on the field. | '0 0 1 * *' | Configures the schedule to run at midnight (00:00) on the first day of each month. |
A range '2-5', indicating the range of accepted values for the field. | '0 0 1-10 * *' | Configures the schedule to run at midnight (00:00) on the first 10 days of each month. |
A list of comma-separated values '2,3,4,5', indicating the list of accepted values for the field. | 0 0 1,11,21 * *' | Configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month. |
A periodicity indicator '*/5' to express how often based on the field's valid range of values a schedule is allowed to run. | '30 */2 1 * *' | Configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. '0 0 */5 * *' configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month. |
A comma-separated list of any of the above except the '*' wildcard is also supported '2,*/5,8-10'. | '0 0 5,*/10,25 * *' | Configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month. |
- (Optional) You can delay the start time of a query by enabling the Delay execution.
Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically exported to the specified destination.
Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications.
(Optional) You can delay the start time of a query by enabling the Delay execution.
You can also send segment data to the target platform by creating an activation in the Audience Studio.
- Navigate to Audience Studio.
- Select a parent segment.
- Open the target segment, right-mouse click, and then select Create Activation.
- In the Details panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters.
- Customize the activation output in the Output Mapping panel.

- Attribute Columns
- Select Export All Columns to export all columns without making any changes.
- Select + Add Columns to add specific columns for the export. The Output Column Name pre-populates with the same Source column name. You can update the Output Column Name. Continue to select + Add Columnsto add new columns for your activation output.
- String Builder
- + Add string to create strings for export. Select from the following values:
- String: Choose any value; use text to create a custom value.
- Timestamp: The date and time of the export.
- Segment Id: The segment ID number.
- Segment Name: The segment name.
- Audience Id: The parent segment number.
- + Add string to create strings for export. Select from the following values:
- Set a Schedule.

- Select the values to define your schedule and optionally include email notifications.
- Select Create.
If you need to create an activation for a batch journey, review Creating a Batch Journey Activation.
You can use TD Toolbelt from the CLI to export to The Trade Desk.
Example
td query \
-d [database] \
-q "SELECT * FROM offline_conversion" \
--type presto \
--result '{
"type": "thetradedesk_crm_data",
"crm_api_token": "xxx",
"advertiser_id": "xxx",
"crm_data_id": "xxx",
"skip_invalid_records": true
}'Within Treasure Workflow, you can specify the use of this data connector to output data.
timezone: UTC
_export:
td:
database: sample_datasets
+td-result-into-target:
td>: queries/sample.sql
result_connection: your_connections_name
result_settings:
crm_api_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
advertiser_id: xxxxxx
crm_data_id: xxx
....Review information on using data connectors in workflow to export data.
Statistic logs for skipping records and upload detail from The Trade Desk are shown at the end of job execution.
2025-08-25 08:02:35.717 +0000 [INFO] (0001:transaction): ************* REPORT *************2025-08-25 08:02:35.717 +0000 [INFO] (0001:transaction): Total records: 42025-08-25 08:02:35.717 +0000 [INFO] (0001:transaction): Uploaded records: 12025-08-25 08:02:35.717 +0000 [INFO] (0001:transaction): Total skipped records: 32025-08-25 08:02:35.721 +0000 [WARN] (0001:transaction): Data error - Skip processing the record index [0]: The required field(s) is(are) null or empty: pii2025-08-25 08:02:35.721 +0000 [WARN] (0001:transaction): Data error - Skip processing the record index [2]: The required field(s) is(are) null or empty: timestamp_utc2025-08-25 08:02:35.721 +0000 [WARN] (0001:transaction): Data error - Skip processing the record index [3]: The required field(s) is(are) null or empty: timestamp_utc2025-08-25 08:02:35.712 +0000 [WARN] (0025:task-0000): =========== UPLOAD STATISTIC FROM TTD ===========2025-08-25 08:02:35.712 +0000 [WARN] (0025:task-0000): ===== Total Records: 12025-08-25 08:02:35.712 +0000 [WARN] (0025:task-0000): ===== Valid Records: 12025-08-25 08:02:35.713 +0000 [WARN] (0025:task-0000): ===== Succeeded Records: 12025-08-25 08:02:35.713 +0000 [WARN] (0025:task-0000): ===== Failed Records: 02025-08-25 08:02:35.713 +0000 [WARN] (0025:task-0000): ===== Empty Records: 02025-08-25 08:02:35.713 +0000 [WARN] (0025:task-0000): ===== Ingested Records: 12025-08-25 08:02:35.713 +0000 [WARN] (0025:task-0000): =================================================