Skip to main content
Mailgun → MarketoIntegration guide

Connecting Mailgun to Marketo

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. Marketo scores leads rather than counting conversions, which means what you send it does not report a number — it changes who your sales team calls tomorrow. The join between them succeeds or fails on one thing: whether the lead record, keyed on email reaches the Mailgun message before the conversion happens, because Marketo can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Product emails from Mailgun as Marketo activities, scanners out

Record clicks on a few buying-intent Mailgun emails, like a trial-ending upgrade link, as custom activities on the Marketo lead via the REST API, but only clicks your application logs as real sessions, since link scanners fake Mailgun clicks. Match product addresses to existing leads first and store the Marketo lead ID on the product account to avoid split leads.

In B2B, Mailgun usually carries the product's own emails: trial reminders, usage alerts, seat limits, invoices. Marketo's scoring never sees them, though a click on a trial-ending email's upgrade link is one of the strongest signals a lead can give. Record those clicks as a custom activity on the Marketo lead through the REST API, keyed on the lead's email, and only for the few messages that mark buying intent.

Filter out link scanners before anything reaches Marketo. Corporate email security clicks every link within seconds of delivery, and Mailgun reports those as clicks. A scoring rule triggered by a scanner can push every lead at a company over the threshold the moment an alert email arrives. Score only clicks that produced a real, logged-in session in your app, recorded by your application rather than taken from Mailgun's clicked webhook.

Watch the email key. Mailgun sends to the address on the product account, which is often not the address on the Marketo lead: personal versus work, or an alias. Pushing an activity with the product address creates a new lead and splits the score across two half-qualified people. Match against existing leads first, and store the Marketo lead ID on the product account once you have it.

Mailgun → Marketo · what breaks

Why this join usually fails — Mailgun → Marketo

  1. 01

    The lead record, keyed on email 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

    A scoring threshold crossed by a duplicate

    Unlike an ad platform, a duplicate here has an operational consequence: a lead is marked sales-ready, routed, and called by a person. Doing that on the strength of an event counted twice wastes the most expensive resource in the funnel.

  4. 04

    Nothing reconciles afterwards

    Marketo shows the activity log on the lead record with the resulting score change. Read the lead, not the API response, and verify no duplicate lead was created.

Mailgun → Marketo · the fix

What working looks like — Mailgun → Marketo

  • The lead record, keyed on email on every message

  • Conversions arriving in Marketo

    The activity lands on the lead, scoring rules evaluate, and the lead may move into a nurture programme or into the sales queue.

  • Reconciled against the source

Mailgun → Marketo · architecture

How Mailgun and Marketo 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

    Marketo needs a click to match

    Marketo needs the lead's email and the activity or custom object you are recording, with the fields the scoring rules actually reference. An activity that no scoring rule looks at changes nothing.

  3. 3

    The identifier is the bridge

    The lead record, keyed on email, 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

    Marketo deduplicates leads on email by default, but activities are not deduplicated. A purchase pushed twice can trigger a scoring rule twice and push a lead over a threshold it should not have crossed.

Mailgun → Marketo · normal or broken

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

Normal, not a fault

  • The lead record, keyed on email present on the message

  • Sent from your order system

  • Deduplicated correctly

    Marketo deduplicates leads on email by default, but activities are not deduplicated. A purchase pushed twice can trigger a scoring rule twice and push a lead over a threshold it should not have crossed.

  • Reconciles with the source

Actually broken

  • The lead record, keyed on 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

    Unlike an ad platform, a duplicate here has an operational consequence: a lead is marked sales-ready, routed, and called by a person. Doing that on the strength of an event counted twice wastes the most expensive resource in the funnel.

  • Nobody has reconciled it

Mailgun → Marketo · diagnose

Diagnostic order — Mailgun → Marketo

  1. 01

    Count messages carrying the lead record, keyed on email

  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

    Check the lead's activity log after a test conversion

    One activity or two, and did the score move by the amount the rule specifies? That is the whole test.

  5. 05

    Read the match rate, not the success message

    Marketo shows the activity log on the lead record with the resulting score change. Read the lead, not the API response, and verify no duplicate lead was created.

Mailgun → Marketo · prove

How it gets proven — Mailgun → Marketo

Source of truth

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

  • The lead record, keyed on email confirmed present on a live message.
  • Activities confirmed on single lead records with score changes matching the configured rules, and no duplicate leads created.
  • Orders reconciled against imported conversions, with the send inventory documented.

Mailgun → Marketo · free audit

What we check in the free audit

  • Count messages carrying the lead record, keyed on email
  • Follow one real conversion end to end
  • Inventory every code path that triggers a send
  • Check the lead's activity log after a test conversion
  • 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 → Marketo · when not to buy

When you don't need this — Mailgun → Marketo

  • Measure identifier coverage yourself first — pull your last hundred messages and count how many carry the lead record, keyed on email.
  • Deliverability monitoring is the right use of Mailgun's data. Attribution belongs at the order.
  • If your sales team does not act on lead scores, pushing conversions into Marketo produces a tidier database and changes nothing about revenue.

Mailgun → Marketo · what we deliver

What gets built — Mailgun → Marketo

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

    The Marketo REST API, posted server-side to create or update the lead and record the activity.

  • 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 → Marketo questions, answered

Record selected clicks as a custom activity on the lead through the Marketo REST API, but only clicks your application confirms as real sessions, not Mailgun's raw click events.

Free · 30 min

Get Mailgun and Marketo joined properly

Free30 minutesNo obligation