> For the complete documentation index, see [llms.txt](https://docs.chord.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chord.co/activate/event-streaming/destinations/advertising/the-trade-desk.md).

# The Trade Desk

**The Trade Desk** is a programmatic advertising platform for display, video, audio, and connected TV campaigns. This destination loads The Trade Desk Universal Pixel JavaScript SDK in the browser and forwards page views, e-commerce events, and conversion data for measurement and audience targeting. There is no server-side component.

## Getting started

This is a browser destination. Chord loads the Trade Desk Universal Pixel for you, so you don't install any script.

You need your Trade Desk advertiser ID and your Universal Pixel ID, both found in your Trade Desk account. The Universal Pixel ID is under **Pixels**.

## Settings

* **Destination Name** (required): a name to tell this destination apart.
* **Advertiser ID** (required): your Trade Desk advertiser ID.
* **Universal Pixel ID** (required): your Universal Pixel ID, found under **Pixels** in your Trade Desk account. All page views and conversion events fire against this single pixel. Trade Desk classifies conversion events from URL patterns and dynamic parameters such as `order_id` and `value`.
* **Consent Requirements** (optional): the consent categories a visitor must accept before Chord sends data to this destination. See [Consent](/activate/event-streaming/consent.md).

## Connect

Add **The Trade Desk** from the destination catalog, using the settings above. See [Connect a destination](/activate/event-streaming/connect-a-destination.md) for the full steps.

## Event mapping

All events include the TTD `event_name` field, mapped from the Chord event name to a [TTD predefined event name](https://partner.thetradedesk.com/v3/portal/data/doc/TrackingTagsEvents#predefined-item-events). Every forwarded event also includes a `pixelIds` array scoped to the Universal Pixel ID.

| Chord event                                                                             | The Trade Desk event                          | Notes                             |
| --------------------------------------------------------------------------------------- | --------------------------------------------- | --------------------------------- |
| `page`                                                                                  | `sitevisit`                                   |                                   |
| [`Order Completed`](/collect-data/tracking-plan/order-completed.md)                     | `purchase`                                    | Revenue data: Yes. Item data: Yes |
| [`Checkout Started`](/collect-data/tracking-plan/checkout-started.md)                   | `startcheckout`                               | Revenue data: Yes. Item data: Yes |
| [`Product Added`](/collect-data/tracking-plan/product-added.md)                         | `addtocart`                                   | Item data: Yes                    |
| [`Product Viewed`](/collect-data/tracking-plan/product-viewed.md)                       | `viewitem`                                    | Item data: Yes                    |
| [`Cart Viewed`](/collect-data/tracking-plan/cart-viewed.md)                             | `viewcart`                                    | Item data: Yes                    |
| [`Product Added to Wishlist`](/collect-data/tracking-plan/product-added-to-wishlist.md) | `addtowishlist`                               | Item data: Yes                    |
| [`Products Searched`](/collect-data/tracking-plan/products-searched.md)                 | `searchitem`                                  | Search query sent as `td1`        |
| `identify`                                                                              | *(not forwarded)*                             |                                   |
| *(other track events)*                                                                  | *(skipped and logged in the browser console)* |                                   |

All events fire against the Universal Pixel ID. TTD infers the conversion type based on URL patterns and dynamic parameters included with each event.

## Page events

Fires a conversion event with `event_name: "sitevisit"`, scoped to the Universal Pixel ID.

**TTD SDK call:** `ttdConversionEvents("event", { event_name: "sitevisit", pixelIds: ["<universalPixelId>"] })`

## Revenue data

For `purchase` and `startcheckout` events, order-level revenue data is included:

| Chord source (priority order)                                                                               | The Trade Desk field | Notes                                                                          |
| ----------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------ |
| `properties.cart_id` > `properties.cartId` > `properties.order_id` > `properties.orderId` > `properties.id` | `order_id`           | Omitted if not present. A cart ID wins over an order ID when both are present  |
| `properties.total` > `properties.value` > `properties.revenue`                                              | `value`              | Omitted if not present. When none is set, Chord uses the sum of product prices |
| `properties.currency` > `properties.meta.i18n.currency`                                                     | `currency`           | Defaults to `USD`                                                              |

## Item data

For events with product information, an `items` array is sent with item-level detail. Multi-product events (`Order Completed`, `Cart Viewed`, `Checkout Started`) map from `properties.products[]`. Single-product events (`Product Added`, `Product Viewed`, `Product Added to Wishlist`) extract from the event properties directly.

| Chord source (priority order) | The Trade Desk field | Notes                                                 |
| ----------------------------- | -------------------- | ----------------------------------------------------- |
| `product_id` > `sku` > `id`   | `item_code`          | Required; products without an identifier are excluded |
| `name`                        | `name`               | Defaults to empty string                              |
| `quantity`                    | `qty`                | Defaults to `1`                                       |
| `price`                       | `price`              | Defaults to `0`                                       |
| `category`                    | `cat`                | Defaults to empty string                              |

## Products Searched

Fires an event with `event_name: "searchitem"`. If `properties.query` is present, it is included as the `td1` dynamic parameter.

## Unmapped events

Chord skips track events not listed above and logs the skip in the browser console. Identify events are not forwarded.

## Initialization

Chord loads `https://js.adsrvr.org/up_loader.3.0.0.js` and calls `ttdConversionEvents("init", { advertiserId, pixelIds: ["<universalPixelId>"] })`. Before the script loads, a queue (`ttdConversionEventsLayer`) buffers any events.

Chord manages SDK loading state (`fresh` → `loading` → `loaded`/`failed`) to prevent duplicate script loads. Concurrent events during loading are queued and processed after initialization completes. If the script fails to load, subsequent events are silently dropped.

## CSP requirements

If your site uses a Content Security Policy, allow the following domains:

| Directive     | Domain                  |
| ------------- | ----------------------- |
| `script-src`  | `https://js.adsrvr.org` |
| `connect-src` | `https://js.adsrvr.org` |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chord.co/activate/event-streaming/destinations/advertising/the-trade-desk.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
