Connecting Mailgun to The Trade Desk
Mailgun is developer-facing email infrastructure, which means the sending logic lives in your application and the marketing team frequently does not know what is being sent or when. The Trade Desk buys across the open internet rather than inside a walled garden, which means it cannot rely on a logged-in graph and has to work with identity you help it construct. The join between them succeeds or fails on one thing: whether Unified ID 2.0, derived from a hashed email reaches the Mailgun message before the conversion happens, because The Trade Desk can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
The Trade Desk needs order emails, not your Mailgun list
Don't build The Trade Desk uploads or audiences from Mailgun recipients; use order and customer tables with recorded consent. Send conversions server-side from orders with normalized hashed email, value and timestamp. Use Mailgun hard bounces to spot checkout email typos. Tag email links and store the touch on orders to compare Trade Desk-attributed orders with email-clicked ones.
The Trade Desk matches conversions through UID2, built from a hashed email, so any system holding addresses looks like a source. Mailgun is the wrong one. Its recipients include everyone your application ever emailed, and UID2 depends on the person's relationship with you and their ability to opt out. Build conversion uploads and any audiences from your order and customer tables, where consent and opt-outs are recorded.
Send conversions server-side from your order system with the order's email normalized and hashed, the order value and the timestamp. Mailgun can help with quality: an address that hard-bounced in Mailgun is unlikely to resolve to a current UID2, and repeated failures point to typos in your checkout's email field worth fixing at the form.
The deduplication question for this pair is across channels. Open-web campaigns build reach, and when buyers come back through a Mailgun cart reminder or win-back email, The Trade Desk may still credit the conversion to an impression. Add a parameter to links in your application's emails, store the email touch on the order, and compare Trade Desk-attributed orders against those that also had an email click before deciding how much the programmatic spend adds.
Mailgun → The Trade Desk · what breaks
Why this join usually fails — Mailgun → The Trade Desk
- 01
Unified ID 2.0, derived from a hashed email never reaches Mailgun
No session, no click, and the trigger conditions are buried in application code rather than in a campaign tool.
- 02
Nobody able to say why a message was sent
When send logic lives in application code, the marketing team cannot audit it and the engineering team is not thinking about attribution. Messages accumulate, nobody owns the list, and any analysis of email's contribution is unreliable.
- 03
View-through conversions on the open internet
A large share of what a DSP claims is view-through: the person saw a display impression and later converted without clicking. Some of that is real influence and some of it is coincidence, and no post-click reporting can separate them. Treat the click-attributed number as the floor and prove the rest with a holdout.
- 04
Nothing reconciles afterwards
The Trade Desk reports match rates on uploaded conversions. Read the match rate — a low one means your authenticated share is the constraint, and no amount of pipeline work will change that.
Mailgun → The Trade Desk · the fix
What working looks like — Mailgun → The Trade Desk
Unified ID 2.0, derived from a hashed email on every message
Conversions arriving in The Trade Desk
The conversion is matched to an impression or click where identity resolves, and feeds the bidding models.
Reconciled against the source
Mailgun → The Trade Desk · architecture
How Mailgun and The Trade Desk actually connect
- 1
Mailgun holds the truth
Because sends are triggered in code, the only reliable description of why a message went out lives in your application, not in Mailgun's logs.
- 2
The Trade Desk needs a click to match
The Trade Desk needs the conversion with a UID2 or a hashed email it can resolve, plus the value and timestamp. Conversions from anonymous visitors cannot be matched at all.
- 3
The identifier is the bridge
Unified ID 2.0, derived from a hashed email, captured at the visit and carried into the Mailgun message.
- 4
The event source decides reliability
Send orders. Use Mailgun events for deliverability monitoring only.
- 5
Deduplication at the destination
Deduplication is on your conversion identifier. Because open-internet buying frequently runs alongside search and social, the more consequential deduplication is across platforms rather than within this one.
Mailgun → The Trade Desk · normal or broken
Working vs. broken, side by side — Mailgun → The Trade Desk
Normal, not a fault
Unified ID 2.0, derived from a hashed email present on the message
Sent from your order system
Deduplicated correctly
Deduplication is on your conversion identifier. Because open-internet buying frequently runs alongside search and social, the more consequential deduplication is across platforms rather than within this one.
Reconciles with the source
Actually broken
Unified ID 2.0, derived from a hashed email missing on most records
No session, no click, and the trigger conditions are buried in application code rather than in a campaign tool.
Sent from the browser
When send logic lives in application code, the marketing team cannot audit it and the engineering team is not thinking about attribution. Messages accumulate, nobody owns the list, and any analysis of email's contribution is unreliable.
Counted twice, or not at all
A large share of what a DSP claims is view-through: the person saw a display impression and later converted without clicking. Some of that is real influence and some of it is coincidence, and no post-click reporting can separate them. Treat the click-attributed number as the floor and prove the rest with a holdout.
Nobody has reconciled it
Mailgun → The Trade Desk · diagnose
Diagnostic order — Mailgun → The Trade Desk
- 01
Count messages carrying Unified ID 2.0, derived from a hashed email
- 02
Follow one real conversion end to end
- 03
Inventory every code path that triggers a send
Usually the first time anyone has, and it frequently finds sends nobody remembers building.
- 04
Split reported conversions into click-through and view-through
If the great majority are view-through, the honest next step is an incrementality test rather than a bid adjustment.
- 05
Read the match rate, not the success message
The Trade Desk reports match rates on uploaded conversions. Read the match rate — a low one means your authenticated share is the constraint, and no amount of pipeline work will change that.
Mailgun → The Trade Desk · prove
How it gets proven — Mailgun → The Trade Desk
Source of truth
Your application's own record of what triggered the send, joined to the order.
- Unified ID 2.0, derived from a hashed email confirmed present on a live message.
- Matched conversions reconciled against your own order records, with the click-through and view-through split stated.
- Orders reconciled against imported conversions, with the send inventory documented.
Mailgun → The Trade Desk · free audit
What we check in the free audit
- Count messages carrying Unified ID 2.0, derived from a hashed email
- Follow one real conversion end to end
- Inventory every code path that triggers a send
- Split reported conversions into click-through and view-through
- Read the match rate, not the success message
Checked against
Your application's own record of what triggered the send, joined to the order.
Free30 minutesNo obligation
Mailgun → The Trade Desk · when not to buy
When you don't need this — Mailgun → The Trade Desk
- Measure identifier coverage yourself first — pull your last hundred messages and count how many carry Unified ID 2.0, derived from a hashed email.
- Deliverability monitoring is the right use of Mailgun's data. Attribution belongs at the order.
- If you cannot collect email addresses from a meaningful share of your buyers, UID2 has little to work with and the open internet is not yet an addressable channel for you.
Mailgun → The Trade Desk · what we deliver
What gets built — Mailgun → The Trade Desk
Identifier capture into Mailgun
Record the trigger reason on the message in your own system and attribute at the order.
Event source: your order system
Send orders. Use Mailgun events for deliverability monitoring only.
Dispatch to The Trade Desk
Server-side conversion upload with the hashed identity and value, from your order system.
Reversals where they exist
Refunds reverse at the order.
Written guarantee
95%+ tracking accuracy
Measured against Your application's own record of what triggered the send, joined to the order.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Mailgun → The Trade Desk questions, answered
No. Use customers whose consent and opt-out status your own customer table tracks. Mailgun recipients include people who only received transactional email.
Record email clicks on each order with a link parameter, then compare Trade Desk-attributed orders against those that also had an email touch.
Almost always because Unified ID 2.0, derived from a hashed email never reached the Mailgun message. No session, no click, and the trigger conditions are buried in application code rather than in a campaign tool. Measure coverage before debugging the dispatch.
UID2 is built from a hashed and salted email address rather than from a cookie, which is the point: it is designed to survive third-party cookie deprecation. It also means the identifier only exists for people who gave you an email, so your addressable share is capped by your own authenticated traffic, not by the platform.
Your order system. Send orders. Use Mailgun events for deliverability monitoring only.
The Trade Desk reports match rates on uploaded conversions. Read the match rate — a low one means your authenticated share is the constraint, and no amount of pipeline work will change that.
More on Mailgun → The Trade Desk
- Stripe → The Trade DeskConnecting Stripe to The Trade Desk
- PayPal → The Trade DeskConnecting PayPal to The Trade Desk
- Shopify → The Trade DeskConnecting Shopify to The Trade Desk
RELATED GUIDES
Where Mailgun → The Trade Desk fits in the rest of your tracking
- Postmark → The Trade DeskConnecting Postmark to The Trade Desk
- SendGrid → The Trade DeskConnecting SendGrid to The Trade Desk
- Resend → The Trade DeskConnecting Resend to The Trade Desk
- Mailgun → OutbrainConnecting Mailgun to Outbrain
- Mailgun → DV360Connecting Mailgun to Display & Video 360
- EcommerceConversion tracking for ecommerce brands, measured against your orders
Free · 30 min
Get Mailgun and The Trade Desk joined properly
Free30 minutesNo obligation
