Skip to main content
Mailgun → MetaIntegration guide

Connecting Mailgun to Meta Conversions API

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. Meta's pixel loses a large share of conversions to Safari, ad blockers and iOS, and the Conversions API exists because of it. The join between them succeeds or fails on one thing: whether the fbc and fbp values reaches the Mailgun message before the conversion happens, because Meta can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Mailgun to Meta CAPI: send the order after the email, not the email

Nothing from Mailgun's event stream belongs in Meta, but the verified emails Mailgun delivers to make strong hashed match keys on a Purchase sent from your order through the Conversions API, with phone too, sharing the order ID as event_id with the pixel. Record the email trigger on orders to count Meta-attributed purchases that followed a cart reminder.

Meta matches heavily on hashed email, and a business sending through Mailgun usually holds verified, deliverable addresses for its customers. That makes the order's email a strong match key on a Purchase sent through the Conversions API. That is the useful overlap. Nothing from Mailgun's event stream belongs in Meta: a delivered or clicked webhook is not a Meta event and has no fbp attached.

The Meta-specific distortion is attribution overlap. With Meta's default 7-day click setting, a customer who clicked an ad on Monday and bought on Thursday after a Mailgun cart reminder is credited to the ad. Sometimes that is fair. When the reminder is what closed the sale, Meta's ROAS absorbs your email program. Record the trigger reason on the order, from the utm_campaign or a send ID, and count how many Meta-attributed purchases followed a triggered email inside the same window.

Email-driven returns are often on a different device from the ad click, so fbc may be missing on those orders; hashed email and phone carry the match. The browser pixel on the thank-you page and the server Purchase still need one shared event_id, normally the order ID.

Mailgun → Meta · what breaks

Why this join usually fails — Mailgun → Meta

  1. 01

    The fbc and fbp values never reaches Mailgun

    No session, no click, and the trigger conditions are buried in application code rather than in a campaign tool.

  2. 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.

  3. 03

    Double counting from broken deduplication

    Server and browser both fire, the event_id does not match, and Meta counts two purchases. Reported ROAS goes up, the business does not, and it can run for months before anyone reconciles against the store.

  4. 04

    Nothing reconciles afterwards

    Events Manager shows received events, the deduplication state and an Event Match Quality score per event. Events arriving is not the test — deduplicated, well-matched events arriving is. Compare Meta's reported purchases against your store's order count for the same window.

Mailgun → Meta · the fix

What working looks like — Mailgun → Meta

  • The fbc and fbp values on every message

  • Conversions arriving in Meta

    Events appear in Events Manager with an Event Match Quality score, deduplicated against the pixel, and become usable for optimization and attribution.

  • Reconciled against the source

Mailgun → Meta · architecture

How Mailgun and Meta actually connect

  1. 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. 2

    Meta Conversions API needs a click to match

    Meta matches server events to people using whatever identifiers you send, hashed with SHA-256 where required. There is no single mandatory key, which is why quality varies so much between implementations — a poorly matched event is accepted, reported, and worth much less than it appears.

  3. 3

    The identifier is the bridge

    The fbc and fbp values, captured at the visit and carried into the Mailgun message.

  4. 4

    The event source decides reliability

    Send orders. Use Mailgun events for deliverability monitoring only.

  5. 5

    Deduplication at the destination

    Meta deduplicates on the pair of event_name and event_id. The browser pixel and the server event must send the same event_id for the same conversion, within the deduplication window. Get this wrong and every purchase counts twice — which is by far the most common Conversions API failure and it inflates reported ROAS rather than reducing it.

Mailgun → Meta · normal or broken

Working vs. broken, side by side — Mailgun → Meta

Normal, not a fault

  • The fbc and fbp values present on the message

  • Sent from your order system

  • Deduplicated correctly

    Meta deduplicates on the pair of event_name and event_id. The browser pixel and the server event must send the same event_id for the same conversion, within the deduplication window. Get this wrong and every purchase counts twice — which is by far the most common Conversions API failure and it inflates reported ROAS rather than reducing it.

  • Reconciles with the source

Actually broken

  • The fbc and fbp values 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

    Server and browser both fire, the event_id does not match, and Meta counts two purchases. Reported ROAS goes up, the business does not, and it can run for months before anyone reconciles against the store.

  • Nobody has reconciled it

Mailgun → Meta · diagnose

Diagnostic order — Mailgun → Meta

  1. 01

    Count messages carrying the fbc and fbp values

  2. 02

    Follow one real conversion end to end

  3. 03

    Inventory every code path that triggers a send

    Usually the first time anyone has, and it frequently finds sends nobody remembers building.

  4. 04

    Read Event Match Quality and the deduplication indicator

    In Events Manager, open the event and check both. A low match quality means weak identifiers; a missing deduplication indicator means your event_id pairing is broken.

  5. 05

    Read the match rate, not the success message

    Events Manager shows received events, the deduplication state and an Event Match Quality score per event. Events arriving is not the test — deduplicated, well-matched events arriving is. Compare Meta's reported purchases against your store's order count for the same window.

Mailgun → Meta · prove

How it gets proven — Mailgun → Meta

Source of truth

Your application's own record of what triggered the send, joined to the order.

  • The fbc and fbp values confirmed present on a live message.
  • Deduplication confirmed in Events Manager on a real purchase, with the browser and server events visibly paired rather than counted twice.
  • Orders reconciled against imported conversions, with the send inventory documented.

Mailgun → Meta · free audit

What we check in the free audit

  • Count messages carrying the fbc and fbp values
  • Follow one real conversion end to end
  • Inventory every code path that triggers a send
  • Read Event Match Quality and the deduplication indicator
  • Read the match rate, not the success message

Checked against

Your application's own record of what triggered the send, joined to the order.

Get my free conversion tracking audit

Free30 minutesNo obligation

Mailgun → Meta · when not to buy

When you don't need this — Mailgun → Meta

  • Measure identifier coverage yourself first — pull your last hundred messages and count how many carry the fbc and fbp values.
  • Deliverability monitoring is the right use of Mailgun's data. Attribution belongs at the order.
  • If you are not running Meta ads at meaningful spend, the Conversions API is effort without payoff. It earns its cost when the optimization signal is worth improving.

Mailgun → Meta · what we deliver

What gets built — Mailgun → Meta

  • 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 Meta

    Server-side events to the Conversions API with the event_id matched to the pixel, action_source set correctly, and customer data hashed before it leaves your infrastructure.

  • 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.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Mailgun → Meta questions, answered

No. Send orders as Purchase with hashed customer email. Delivered, opened and clicked events are deliverability data, not conversions.

Free · 30 min

Get Mailgun and Meta joined properly

Free30 minutesNo obligation