Skip to main content
Mailgun → HubSpotIntegration guide

Connecting Mailgun to HubSpot

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. HubSpot is where sales works, so a conversion that never reaches it is invisible to the people who decide what a lead was worth. The join between them succeeds or fails on one thing: whether the contact identity — email, or the hubspotutk cookie reaches the Mailgun message before the conversion happens, because HubSpot can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Mailgun to HubSpot: email activity on the contact, revenue elsewhere

Mailgun has no conversions for HubSpot; send its delivered, clicked, bounced, unsubscribed and complained webhooks as custom events or timeline activity keyed on recipient email, checking your HubSpot tier. Sync hard bounces and complaints into a HubSpot property or list so marketing stops mailing dead addresses. Opens aren't conversions; the deal or order is.

Mailgun has no conversions to send; it sends messages. What HubSpot can usefully get from it is the contact-level activity your application email generates, such as delivered, clicked, bounced, unsubscribed and complained, so sales can see that a trial-ending notice was clicked or a password reset bounced. Mailgun's webhooks expose those events; send them to HubSpot as custom events or timeline activity keyed on the recipient email, and check which HubSpot tier your account needs for custom events.

Bounces and complaints matter most. If Mailgun suppresses an address after a hard bounce or a spam complaint and HubSpot keeps marketing to it, your HubSpot sending reputation pays for an address your application already knew was dead or hostile. Sync those suppressions into a HubSpot property or list so both systems agree on who not to email.

Do not use Mailgun opens as a conversion signal in HubSpot. Apple Mail Privacy Protection loads images automatically, so opens are inflated for a large share of recipients. Clicks are better but still not revenue. The deal or order is the conversion; Mailgun data belongs on the timeline as context and in your send inventory, not in HubSpot's attribution reports.

Mailgun → HubSpot · what breaks

Why this join usually fails — Mailgun → HubSpot

  1. 01

    The contact identity — email, or the hubspotutk cookie 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

    Duplicate contacts

    Two records for one person, each with half the history. Every downstream report is then wrong in a way that looks like a data problem rather than an integration problem.

  4. 04

    Nothing reconciles afterwards

    HubSpot shows the contact record and its timeline. A successful API response means HubSpot accepted the call, not that it resolved to the right contact — open the record and look.

Mailgun → HubSpot · the fix

What working looks like — Mailgun → HubSpot

  • The contact identity — email, or the hubspotutk cookie on every message

  • Conversions arriving in HubSpot

    The revenue or conversion lands on the contact record and its associated deal, where sales can see it and where HubSpot's own attribution reporting can use it.

  • Reconciled against the source

Mailgun → HubSpot · architecture

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

    HubSpot needs a click to match

    HubSpot needs to resolve the incoming data to an existing contact or create one. Without an email or a hubspotutk it creates duplicates, and duplicate contacts break every report built on top of them.

  3. 3

    The identifier is the bridge

    The contact identity — email, or the hubspotutk cookie, 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

    HubSpot deduplicates contacts on email address. Events and property updates against the same contact are idempotent by design, but a second contact created for the same person is not detected, and merging them afterwards is manual work.

Mailgun → HubSpot · normal or broken

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

Normal, not a fault

  • The contact identity — email, or the hubspotutk cookie present on the message

  • Sent from your order system

  • Deduplicated correctly

    HubSpot deduplicates contacts on email address. Events and property updates against the same contact are idempotent by design, but a second contact created for the same person is not detected, and merging them afterwards is manual work.

  • Reconciles with the source

Actually broken

  • The contact identity — email, or the hubspotutk cookie 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

    Two records for one person, each with half the history. Every downstream report is then wrong in a way that looks like a data problem rather than an integration problem.

  • Nobody has reconciled it

Mailgun → HubSpot · diagnose

Diagnostic order — Mailgun → HubSpot

  1. 01

    Count messages carrying the contact identity — email, or the hubspotutk cookie

  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

    Search for the test contact by email after sending

    One record or two? Then check whether the properties landed on the contact or only on the form submission — they are different things and only the first is usable.

  5. 05

    Read the match rate, not the success message

    HubSpot shows the contact record and its timeline. A successful API response means HubSpot accepted the call, not that it resolved to the right contact — open the record and look.

Mailgun → HubSpot · prove

How it gets proven — Mailgun → HubSpot

Source of truth

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

  • The contact identity — email, or the hubspotutk cookie confirmed present on a live message.
  • One contact record confirmed, not two, with the property visible on the contact rather than only on the submission.
  • Orders reconciled against imported conversions, with the send inventory documented.

Mailgun → HubSpot · free audit

What we check in the free audit

  • Count messages carrying the contact identity — email, or the hubspotutk cookie
  • Follow one real conversion end to end
  • Inventory every code path that triggers a send
  • Search for the test contact by email after sending
  • 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 → HubSpot · when not to buy

When you don't need this — Mailgun → HubSpot

  • Measure identifier coverage yourself first — pull your last hundred messages and count how many carry the contact identity — email, or the hubspotutk cookie.
  • Deliverability monitoring is the right use of Mailgun's data. Attribution belongs at the order.
  • HubSpot's native form and tracking code already handle the straightforward cases well. This is worth building when the conversion happens somewhere HubSpot's code cannot see.

Mailgun → HubSpot · what we deliver

What gets built — Mailgun → HubSpot

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

    The HubSpot API — contact create-or-update with the properties, or a custom behavioral event where you need the timeline entry rather than a property.

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

Yes, by sending Mailgun webhook events to HubSpot as custom events or timeline activity keyed on email. Check which HubSpot tier your account needs for custom events.

Free · 30 min

Get Mailgun and HubSpot joined properly

Free30 minutesNo obligation