The Trade Desk Event Tracking
Overview
The Trade Desk (TTD) uses the Universal Pixel (UPixel) for conversion tracking, audience building, and campaign optimization across its demand-side platform. As a programmatic advertising platform, The Trade Desk provides enterprise-grade tracking for display, video, audio, connected TV, and native advertising across premium publisher inventory.
Standard Events
The Trade Desk Universal Pixel supports various event types:
Ecommerce Events
- Purchase - Transaction completed
- AddToCart - Product added to cart
- ViewItem - Product page viewed
- InitiateCheckout - Checkout started
- AddPaymentInfo - Payment information added
Lead Generation Events
- Lead - Form submission or lead capture
- CompleteRegistration - Account registration
- Subscribe - Newsletter or service subscription
- Contact - Contact form or inquiry
Engagement Events
- PageView - Standard page visit (automatically tracked)
- ViewContent - Content page viewed
- Search - Site search performed
- Download - File or resource download
Custom Events
- Custom - Business-specific conversion actions
Custom Events
Creating Custom Conversions
Define custom event tracking for specific business goals:
// Custom event example
ttd_dom_ready(function() {
if (typeof TTDUniversalPixelApi === 'function') {
var universalPixelApi = new TTDUniversalPixelApi();
universalPixelApi.init("ADVERTISER_ID", ["TRACKER_ID"], "https://insight.adsrvr.org/track/up", "ttdUniversalPixelTags");
}
});
// Fire custom event
ttdUniversalPixelTags.push({
event: 'custom_event_name',
event_id: 'unique_event_id',
value: 25.00,
currency: 'USD'
});
Event Parameters
Add parameters to any event:
ttdUniversalPixelTags.push({
event: 'Purchase',
event_id: 'ORDER_12345',
value: 99.99,
currency: 'USD',
items: [{
id: 'SKU_123',
name: 'Blue Widget',
quantity: 2,
price: 49.99
}]
});
Ecommerce Events
Purchase Tracking
Complete purchase implementation:
<!-- Universal Pixel Base Code (on all pages) -->
<script src="https://js.adsrvr.org/up_loader.1.1.0.js" type="text/javascript"></script>
<script type="text/javascript">
ttd_dom_ready(function() {
if (typeof TTDUniversalPixelApi === 'function') {
var universalPixelApi = new TTDUniversalPixelApi();
universalPixelApi.init("ADVERTISER_ID", ["TRACKER_ID"], "https://insight.adsrvr.org/track/up");
}
});
</script>
<!-- Purchase Event (on confirmation page) -->
<script type="text/javascript">
ttd_dom_ready(function() {
if (typeof TTDUniversalPixelApi === 'function') {
var universalPixelApi = new TTDUniversalPixelApi();
universalPixelApi.init("ADVERTISER_ID", ["PURCHASE_TRACKER_ID"], "https://insight.adsrvr.org/track/up");
}
});
// Track purchase
if (window.ttdUniversalPixelTags) {
ttdUniversalPixelTags.push({
event: 'Purchase',
event_id: 'ORDER_12345',
value: 149.99,
currency: 'USD',
items: [
{ id: 'SKU_123', quantity: 1, price: 99.99 },
{ id: 'SKU_456', quantity: 2, price: 25.00 }
]
});
}
</script>
Shopping Funnel Tracking
Track complete customer journey:
// View Item (Product Page)
ttdUniversalPixelTags.push({
event: 'ViewItem',
items: [{
id: 'SKU_123',
name: 'Blue Widget',
price: 99.99
}]
});
// Add to Cart
ttdUniversalPixelTags.push({
event: 'AddToCart',
value: 99.99,
currency: 'USD',
items: [{
id: 'SKU_123',
quantity: 1,
price: 99.99
}]
});
// Initiate Checkout
ttdUniversalPixelTags.push({
event: 'InitiateCheckout',
value: 149.99,
currency: 'USD'
});
// Purchase
ttdUniversalPixelTags.push({
event: 'Purchase',
event_id: 'ORDER_12345',
value: 149.99,
currency: 'USD',
items: [
{ id: 'SKU_123', quantity: 1, price: 99.99 },
{ id: 'SKU_456', quantity: 2, price: 25.00 }
]
});
Conversion Tracking
Implementation Methods
1. Universal Pixel (Standard)
JavaScript implementation:
<!-- Universal Pixel Script -->
<script src="https://js.adsrvr.org/up_loader.1.1.0.js" type="text/javascript"></script>
<script type="text/javascript">
ttd_dom_ready(function() {
if (typeof TTDUniversalPixelApi === 'function') {
var universalPixelApi = new TTDUniversalPixelApi();
universalPixelApi.init("YOUR_ADVERTISER_ID", ["YOUR_TRACKER_ID"], "https://insight.adsrvr.org/track/up");
}
});
</script>
<!-- Event Tracking -->
<script type="text/javascript">
if (window.ttdUniversalPixelTags) {
ttdUniversalPixelTags.push({
event: 'Purchase',
event_id: 'ORDER_12345',
value: 99.99,
currency: 'USD'
});
}
</script>
2. Image Pixel (Fallback)
For non-JavaScript environments:
<!-- Image Pixel -->
<img height="1" width="1" style="border-style:none;" alt="" src="https://insight.adsrvr.org/track/conv/?adv=ADVERTISER_ID&ct=TRACKER_ID&fmt=3&v=VALUE&vf=USD&orderid=ORDER_12345"/>
3. Server-Side Tracking
Server-to-server conversion tracking:
import requests
# Server-side conversion
pixel_url = "https://insight.adsrvr.org/track/conv/"
params = {
"adv": "ADVERTISER_ID",
"ct": "TRACKER_ID",
"fmt": "3",
"v": "99.99",
"vf": "USD",
"orderid": "ORDER_12345",
"td1": "click_id", # TTD click ID if available
"upixel": "1"
}
response = requests.get(pixel_url, params=params)
4. Google Tag Manager
Deploy via GTM:
Base Pixel Tag:
<!-- GTM Custom HTML Tag - All Pages -->
<script src="https://js.adsrvr.org/up_loader.1.1.0.js" type="text/javascript"></script>
<script type="text/javascript">
ttd_dom_ready(function() {
if (typeof TTDUniversalPixelApi === 'function') {
var universalPixelApi = new TTDUniversalPixelApi();
universalPixelApi.init("{{TTD Advertiser ID}}", ["{{TTD Tracker ID}}"], "https://insight.adsrvr.org/track/up");
}
});
</script>
Conversion Event Tag:
<script type="text/javascript">
if (window.ttdUniversalPixelTags) {
ttdUniversalPixelTags.push({
event: 'Purchase',
event_id: {{Transaction ID}},
value: {{Transaction Value}},
currency: 'USD'
});
}
</script>
Multiple Trackers
Track same event to multiple tracker IDs:
// Initialize with multiple trackers
ttd_dom_ready(function() {
if (typeof TTDUniversalPixelApi === 'function') {
var universalPixelApi = new TTDUniversalPixelApi();
universalPixelApi.init("ADVERTISER_ID",
["TRACKER_ID_1", "TRACKER_ID_2", "TRACKER_ID_3"],
"https://insight.adsrvr.org/track/up");
}
});
Offline Conversions
Server-Side Upload
Upload offline conversions via server-to-server calls:
// Node.js server-side conversion
const axios = require('axios');
const conversionData = {
adv: 'ADVERTISER_ID',
ct: 'TRACKER_ID',
fmt: '3',
v: '149.99',
vf: 'USD',
orderid: 'OFFLINE_ORDER_12345',
td1: click_id, // TTD click ID from CRM
td2: customer_id,
upixel: '1'
};
await axios.get('https://insight.adsrvr.org/track/conv/', {
params: conversionData
});
CRM Integration
Connect CRM for offline conversion tracking:
Implementation:
- Capture TTD click ID (TDID parameter or cookie)
- Store in CRM with customer record
- Export offline conversions with TTD ID
- Upload via server-side pixel
Click ID Capture:
// Capture TDID from URL or cookie
function getTTDID() {
// From URL parameter
const urlParams = new URLSearchParams(window.location.search);
const tdid = urlParams.get('tdid');
// Or from cookie
// const tdid = getCookie('TDID');
if (tdid) {
// Store in form or database
document.getElementById('tdid_field').value = tdid;
}
}
Attribution
Attribution Windows
The Trade Desk uses customizable attribution:
Default Settings:
- Post-click: 30 days
- Post-view: 1 day
Customizable:
- Click attribution: 1-90 days
- View attribution: 1-30 days
- Configure per tracker in platform
Attribution Models
The Trade Desk supports multiple attribution models:
- Last Touch - Last TTD interaction gets credit
- First Touch - First TTD interaction gets credit
- Linear - Equal credit across all TTD interactions
- Time Decay - More recent interactions get more credit
- Data-Driven - Algorithmic attribution (requires sufficient data)
Configure in: TTD Platform > Reporting > Attribution Settings
Cross-Device Attribution
The Trade Desk provides:
- Unified ID 2.0 - Identity graph for cross-device tracking
- Deterministic matching - Logged-in user identification
- Probabilistic matching - Device graph connections
Cross-Channel Measurement
Track conversions across TTD channels:
- Display
- Video (online and CTV)
- Audio
- Native
- Digital out-of-home
Debugging & Validation
Browser DevTools
Verify pixel implementation:
Network Tab:
- Open browser DevTools
- Navigate to Network tab
- Filter for "adsrvr.org"
- Verify:
- up_loader.js loads successfully
- /track/up requests fire
- Parameters pass correctly
Console Verification:
// Check if UPixel loaded
if (typeof TTDUniversalPixelApi !== 'undefined') {
console.log('TTD Universal Pixel loaded');
} else {
console.error('TTD Universal Pixel not found');
}
// Check pixel queue
console.log(window.ttdUniversalPixelTags);
Platform Validation
Verify in The Trade Desk platform:
- Navigate to Tracking Tags section
- Select your tracker
- Review Recent Activity:
- Impression volume
- Click volume
- Conversion volume
- Check for implementation warnings
Test Conversions
Generate test conversions:
- Create test tracker in TTD platform
- Implement test tracker on staging site
- Generate test conversion
- Verify appears in platform within 1-2 hours
Common Issues
Pixel not loading:
- Verify advertiser ID and tracker ID correct
- Check up_loader.js loads without errors
- Ensure ttd_dom_ready function executes
- Test without content blockers
Conversions not tracking:
- Verify tracker ID matches platform configuration
- Check event fires after page load
- Confirm value format is numeric
- Review attribution window settings
Duplicate conversions:
- Implement event_id for deduplication
- Check pixel doesn't fire multiple times
- Verify GTM triggers aren't overlapping
Best Practices
Implementation
- Use Universal Pixel for all modern implementations
- Implement on all pages for complete user journey
- Use unique tracker IDs for different conversion types
- Include event_id for deduplication
- Deploy via GTM for centralized management
Event Strategy
- Create separate trackers for different conversion values
- Track micro-conversions for audience building
- Use multiple trackers for funnel analysis
- Implement value-based tracking for ecommerce
- Track post-view conversions separately
Data Quality
- Pass accurate conversion values for optimization
- Use consistent currency codes (USD, EUR, etc.)
- Include order IDs for deduplication
- Send item-level data for product-level insights
- Regular audits of pixel implementation
Privacy & Compliance
- Implement consent management for GDPR/CCPA
- Use Unified ID 2.0 for privacy-forward identity
- Honor user opt-outs via platform controls
- Update privacy policy to disclose TTD tracking
- Follow TTD's data policies for compliant usage
Optimization
- Use conversion-based bidding for performance campaigns
- Leverage Koa AI for automated optimization
- Create audience segments from converters
- Exclude recent converters from acquisition
- Test different attribution windows based on sales cycle
Campaign Strategy
- Align trackers with campaign objectives
- Use cross-device targeting for complete reach
- Leverage CTV for upper-funnel awareness
- Implement frequency capping to avoid fatigue
- Test different creatives with A/B tracking
Measurement
- Track incrementality with control groups
- Measure cross-channel impact via attribution
- Monitor view-through vs click-through conversions
- Analyze conversion paths for optimization
- Export data to BI tools via API
Programmatic Best Practices
- Use private marketplace deals for premium inventory
- Implement brand safety controls
- Leverage first-party data for targeting
- Test different supply paths for efficiency
- Monitor viewability and ad fraud metrics
Reporting
- Break down by channel (display, video, CTV, audio)
- Segment by device and operating system
- Compare attribution models for insights
- Track conversion lag to optimize windows
- Create custom reports via API
Testing
- Test on staging environment before production
- Verify all tracker IDs are correct
- Generate test conversions for validation
- Monitor for first 48 hours after launch
- Use browser DevTools for troubleshooting