Skip to main content
Mailgun → Google AdsIntegration guide

Connecting Mailgun to Google Ads

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. Google Ads knows what you spent and which click it came from, and nothing at all about what happened afterwards. The join between them succeeds or fails on one thing: whether the GCLID reaches the Mailgun message before the conversion happens, because Google Ads can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Mailgun to Google Ads: keep email clicks out of your conversions

Upload orders to Google Ads with the gclid from the preceding click, stored once and replaced only by a newer gclid, so email returns without a gclid don't erase it. Never upload Mailgun opens or clicks as conversions. Use enhanced conversions with the order's hashed email as fallback, not Mailgun recipient logs. Send refunds as adjustments, within 90 days.

Google Ads needs the order uploaded with the gclid from the click that preceded it. The Mailgun-specific question is what happens when that customer later returns through an email: the link opens your site without a gclid, and if your capture script overwrites the stored click ID with an empty value on every visit, an order that came from an ad is uploaded with nothing to match. Store the gclid once and replace it only with a newer gclid.

Never upload Mailgun opened or clicked events as conversion actions. Opens are inflated by mail privacy features that preload images, and clicks include automated link scanning. Neither is a decision a person made, and Smart Bidding would learn to favor whatever audience your code emails most.

Where gclid coverage on orders is weak, enhanced conversions using the hashed email on the order is the better fallback, and businesses sending through Mailgun usually have verified addresses for most customers. Match on the order's email, not on Mailgun's recipient logs. Refunds go back as conversion adjustments against the original order, and any upload must land within 90 days of the click.

Mailgun → Google Ads · what breaks

Why this join usually fails — Mailgun → Google Ads

  1. 01

    The GCLID 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

    The conversion action is the wrong type

    Uploads against a standard website conversion action fail. The action has to be created as 'Import' — and existing actions cannot be converted, so this is discovered late and requires starting a new action with no history.

  4. 04

    Nothing reconciles afterwards

    Google Ads reports uploads in Goals → Conversions → Uploads, with rows accepted and rows failed. A green result means the file parsed, not that the clicks matched. The number to watch is how many conversions actually appear against campaigns afterwards.

Mailgun → Google Ads · the fix

What working looks like — Mailgun → Google Ads

  • The GCLID on every message

  • Conversions arriving in Google Ads

    Conversions appear against the campaign, ad group and keyword that produced the click, with the value you sent — which is what lets Smart Bidding optimize toward revenue instead of toward form fills.

  • Reconciled against the source

Mailgun → Google Ads · architecture

How Mailgun and Google Ads 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

    Google Ads needs a click to match

    Google Ads matches an uploaded conversion back to a click using the GCLID. The conversion action must be created as an import type — an upload against a website-tag conversion action is rejected. Uploads must also land inside Google's window: the click has to be within the last 90 days.

  3. 3

    The identifier is the bridge

    The GCLID, 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

    Google deduplicates on the combination of GCLID, conversion action and conversion time. Uploading the same click twice against the same action at the same timestamp is rejected rather than double-counted, but uploading it against a second conversion action counts twice — which is how most double-counting here actually happens.

Mailgun → Google Ads · normal or broken

Working vs. broken, side by side — Mailgun → Google Ads

Normal, not a fault

  • The GCLID present on the message

  • Sent from your order system

  • Deduplicated correctly

    Google deduplicates on the combination of GCLID, conversion action and conversion time. Uploading the same click twice against the same action at the same timestamp is rejected rather than double-counted, but uploading it against a second conversion action counts twice — which is how most double-counting here actually happens.

  • Reconciles with the source

Actually broken

  • The GCLID 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

    Uploads against a standard website conversion action fail. The action has to be created as 'Import' — and existing actions cannot be converted, so this is discovered late and requires starting a new action with no history.

  • Nobody has reconciled it

Mailgun → Google Ads · diagnose

Diagnostic order — Mailgun → Google Ads

  1. 01

    Count messages carrying the GCLID

  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 conversion action type and the upload diagnostics

    In Google Ads, Goals → Conversions → Uploads shows every upload with its error rows. Read the errors rather than the success count; a file can import successfully with most rows rejected.

  5. 05

    Read the match rate, not the success message

    Google Ads reports uploads in Goals → Conversions → Uploads, with rows accepted and rows failed. A green result means the file parsed, not that the clicks matched. The number to watch is how many conversions actually appear against campaigns afterwards.

Mailgun → Google Ads · prove

How it gets proven — Mailgun → Google Ads

Source of truth

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

  • The GCLID confirmed present on a live message.
  • The Uploads diagnostics read row by row, with the accepted count reconciled against conversions appearing in campaign reporting.
  • Orders reconciled against imported conversions, with the send inventory documented.

Mailgun → Google Ads · free audit

What we check in the free audit

  • Count messages carrying the GCLID
  • Follow one real conversion end to end
  • Inventory every code path that triggers a send
  • Check the conversion action type and the upload diagnostics
  • 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 → Google Ads · when not to buy

When you don't need this — Mailgun → Google Ads

  • Measure identifier coverage yourself first — pull your last hundred messages and count how many carry the GCLID.
  • Deliverability monitoring is the right use of Mailgun's data. Attribution belongs at the order.
  • If your sales close inside a few days and your website tag already reports accurately, you may not need offline import at all. It exists to solve the delay between click and revenue.

Mailgun → Google Ads · what we deliver

What gets built — Mailgun → Google Ads

  • 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 Google Ads

    Offline Conversion Import through the Google Ads API, or a scheduled upload. Enhanced conversions for leads where GCLID coverage is poor and you have consented email addresses.

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

Import orders, not email events. A Mailgun click or open is not a conversion and would teach bidding the wrong thing.

Free · 30 min

Get Mailgun and Google Ads joined properly

Free30 minutesNo obligation