Skip to main content

Ads and growth

The Trade Desk

The Trade Desk Universal Pixel records conversions and builds ad audiences. The c15t theTradeDeskPixel helper waits until the marketing category is allowed before it defines the pixel globals and adds the loader.

The Trade Desk has no API to stop its SDK. When the visitor withdraws, the helper leaves the SDK on the page, and c15t's default page reload removes it.

Configure The Trade Desk

Copy the advertiser ID and Universal Pixel IDs from your account snippet. This helper uses the Universal Pixel 3 loader. Unified ID 2.0 setup is separate. Then delete the direct snippet and any tag manager copy, so they can't load The Trade Desk without consent.

npm install @c15t/integrations
src/consent-scripts.ts
import { theTradeDeskPixel } from '@c15t/integrations/the-trade-desk';

export const scripts = [
	theTradeDeskPixel({ advertiserId: 'ADVERTISER_ID', pixelIds: ['PIXEL_ID'] }),
];

Register the scripts

Complete your framework quickstart first. Keep its Inth endpoint, policy, styles and consent UI. Remove the vendor's original script, SDK initializer or tag-manager entry, so the vendor loads only through c15t.

The vendor pages put the helper in src/consent-scripts.ts. If your framework quickstart already has a scripts array, such as the one in c15t.config.ts in the Next.js guide, add the helper to that array instead of creating a second file. The scripts export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration point for your framework below. These are edits to that provider, not a second provider.

Add the configuration to scripts in c15t.config.ts, next to next.config.ts:

import { defineConsentConfig } from 'c15t/next';
import { scripts } from './src/consent-scripts';

export default defineConsentConfig({ scripts });

Keep the rest of your config, such as mode and routePrefix, in the same call. ConsentRoot reads the config in the browser, so the layout keeps passing only state. App Router, Pages Router and static export all read the same file. See Next.js scripts and embeds.

Options

OptionDefaultBehavior
advertiserIdRequiredPublic advertiser ID. Trimmed. If it's missing or blank, c15t logs an error and never loads the pixel.
pixelIdsRequiredNonempty array of public Universal Pixel IDs, each trimmed. If the array is empty or any entry is blank, c15t logs an error and skips the whole helper.
enableCookieSyncingVendor defaultPassed to init when set. false turns off cookie syncing, but it doesn't stop all cookies and doesn't make loading before consent safe.
dataProcessingOptionNoneLimited data use setting, such as { policies: ['LDU'], region: 'US-CO' }. It doesn't replace consent.
scriptUrlhttps://js.adsrvr.org/up_loader.3.0.0.jsLoader URL override. A blank value uses the default. Walmart DSP accounts use https://azjs.adsrvr.org/thetradedesk-ads/up_loader.3.0.0.js.

Loading and revocation

When marketing is allowed, the helper creates the ttdConversionEventsLayer array and a ttdConversionEvents function that pushes each call's arguments onto it. It queues one init call and one event call, then adds the loader as an async script. If you set dataProcessingOption, the helper passes it as dataProcessingOption to init and as data_processing_option on the event. If your page already defines ttdConversionEvents or the layer, the helper leaves them alone.

The SDK reads TCF and GPP signals where they apply. Those signals control what the vendor does after it loads. They don't replace the c15t gate. Send your own conversion calls only while marketing and any vendor consent stay granted.

The Trade Desk documents no way to stop or tear down the SDK in the browser. On withdrawal, the helper keeps the loader element on the page. Keep c15t's default reloadOnConsentRevoked enabled. Without the reload, existing code, requests and frames can keep running until the visitor navigates. If the visitor grants consent again on the same page, the helper reuses that loader and doesn't queue init or the event a second time.

Cookies and storage

The Trade Desk documents the TDID identifier cookie on adsrvr.org, with a one-year lifetime. A read-only request using the guide's sample IDs returned a TDID cookie even with cookie syncing turned off. The served SDK also reads local storage debugging flags and can read existing GA4 cookies when configured. This list isn't a complete cookie inventory.

For CSP, the guide lists js.adsrvr.org for scripts, and insight.adsrvr.org and match.adsrvr.org for frames. Realtime conversion connections use insight.adsrvr.org. Account options can add hosts.

Verify The Trade Desk

In a fresh browser profile, deny consent and allow only an unrelated category. Filter Network by adsrvr.org and confirm that no requests, globals, cookies, local storage or session storage appear. Grant marketing and check the loader URL against your account snippet. Withdraw consent and confirm the page reloads. The Trade Desk must stay blocked on the new page. Check storage in DevTools as well as Network.

The browser monitor blocks collection, so it doesn't confirm that your account receives events.

Sources: Universal Pixel guide and privacy policy.

Test in a private window with an opt-in policy. Open DevTools Network, disable the cache and filter by the vendor's domain:

  1. Load the page. No request goes to the vendor before you choose.
  2. Click Reject, then reload. There is still no vendor request.
  3. Open Privacy settings and allow the helper's category. The vendor script loads without a page reload.
  4. Turn the category off again and save. c15t reloads the page, and the new page makes no vendor request.

c15t reloads on revocation because removing a script element does not stop code that already ran. The vendor's listeners, timers and queued events stay alive until the page unloads. If you set reloadOnConsentRevoked: false, stop the vendor yourself. Register a callback-only script whose onConsentChange calls the vendor's opt-out API, as shown in custom integrations, and check the permission before each of your own event calls. The reload does not delete cookies the vendor already set; see clear on revocation for your framework.

The helper lists its vendor by name in the preference dialog, so a visitor can turn it off inside an allowed category. See vendor consent for your framework. The consent verification guide covers navigation, expiry and hosting checks.