Skip to main content
Contact Form 7 → MixpanelIntegration guide

Connecting Contact Form 7 to Mixpanel

Contact Form 7 is free, everywhere, and stores nothing by default — which is the whole problem. Mixpanel is a product analytics tool, not an ad platform, which means it has no attribution model of its own and will faithfully report whatever event schema you give it — including a bad one. The join between them succeeds or fails on one thing: whether the distinct_id reaches the Contact Form 7 submission before the conversion happens, because Mixpanel can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Contact Form 7 to Mixpanel without splitting the visitor in two

To send Contact Form 7 submissions to Mixpanel, copy the browser SDK's distinct_id into a hidden field at page load and use it on the server event, or the lead becomes a new one-event person. Use the stored submission ID as $insert_id, keep email as a profile property rather than calling identify, and agree one event name.

Mixpanel's browser SDK gives each visitor a distinct_id before they ever touch the form. When Contact Form 7 submits over AJAX and your PHP sends an event, that server call has no idea which distinct_id was browsing unless the form handed it over. Put the current distinct_id into a hidden field when the page loads and use it on the server event; otherwise the lead appears as a separate person with exactly one event and no history.

Do not call identify with the submitted email address as the user ID. A contact form is not a login, the same person can submit twice with different addresses, and someone can type a colleague's email. Store the email as a profile property if you need it, and leave identity merging to your actual signup flow. Use the submission ID from your storage layer as $insert_id so retries collapse.

Name the event once and agree on it with whoever owns the Mixpanel project. A WordPress agency adding "Contact Form Submit" next to a product team's "lead_created" is the near-duplicate problem in its most common form, and nobody notices until a funnel shows half the leads it should.

Contact Form 7 → Mixpanel · what breaks

Why this join usually fails — Contact Form 7 → Mixpanel

  1. 01

    The distinct_id never reaches Contact Form 7

    There is no entries table to write to, so the identifier has to be captured into a hidden field and persisted by whatever you add for storage. Contact Form 7 submits over AJAX, so the page does not reload and anything expecting a navigation event never fires.

  2. 02

    AJAX submission means no page load to hook

    Setups that fire a conversion on thank-you-page load simply never fire. Setups that listen for the DOM event miss anyone whose script execution was blocked or deferred.

  3. 03

    One event schema, two teams, no agreement

    Marketing names an event Purchase, the product team names it purchase_completed, and both are sent. Mixpanel treats them as unrelated, every funnel silently splits, and two teams spend a quarter arguing about which number is right when both are.

  4. 04

    Nothing reconciles afterwards

    Mixpanel shows events in the live view within moments. Check that the distinct_id matches the signed-in user rather than a lingering anonymous ID, because that is the failure that quietly breaks every cross-signup funnel.

Contact Form 7 → Mixpanel · the fix

What working looks like — Contact Form 7 → Mixpanel

  • The distinct_id on every submission

  • Conversions arriving in Mixpanel

    The event lands on the user profile and becomes available in funnels, retention and cohort analysis.

  • Reconciled against the source

Contact Form 7 → Mixpanel · architecture

How Contact Form 7 and Mixpanel actually connect

  1. 1

    Contact Form 7 holds the truth

    Out of the box Contact Form 7 emails the submission and keeps no record. Before any attribution work is meaningful, submissions have to be stored somewhere queryable. That is step one and it is not optional.

  2. 2

    Mixpanel needs a click to match

    Mixpanel needs a distinct_id, an event name and its properties. Events without a distinct_id are rejected; events with the wrong one land on a stranger's profile.

  3. 3

    The identifier is the bridge

    The distinct_id, captured at the visit and carried into the Contact Form 7 submission.

  4. 4

    The event source decides reliability

    Fire server-side from PHP. The browser-side wpcf7mailsent DOM event exists and is commonly used, but it depends on the visitor's browser executing correctly and on the AJAX response arriving — the server hook does not.

  5. 5

    Deduplication at the destination

    Mixpanel deduplicates on $insert_id within a time window. Without it, a retried server request creates a second event, and because Mixpanel is where product decisions get made, that inflation ends up in a roadmap rather than in an ad report.

Contact Form 7 → Mixpanel · normal or broken

Working vs. broken, side by side — Contact Form 7 → Mixpanel

Normal, not a fault

  • The distinct_id present on the submission

  • Sent from the wpcf7_mail_sent hook

  • Deduplicated correctly

    Mixpanel deduplicates on $insert_id within a time window. Without it, a retried server request creates a second event, and because Mixpanel is where product decisions get made, that inflation ends up in a roadmap rather than in an ad report.

  • Reconciles with the source

Actually broken

  • The distinct_id missing on most records

    There is no entries table to write to, so the identifier has to be captured into a hidden field and persisted by whatever you add for storage. Contact Form 7 submits over AJAX, so the page does not reload and anything expecting a navigation event never fires.

  • Sent from the browser

    Setups that fire a conversion on thank-you-page load simply never fire. Setups that listen for the DOM event miss anyone whose script execution was blocked or deferred.

  • Counted twice, or not at all

    Marketing names an event Purchase, the product team names it purchase_completed, and both are sent. Mixpanel treats them as unrelated, every funnel silently splits, and two teams spend a quarter arguing about which number is right when both are.

  • Nobody has reconciled it

Contact Form 7 → Mixpanel · diagnose

Diagnostic order — Contact Form 7 → Mixpanel

  1. 01

    Count submissions carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Confirm submissions are being stored at all

    If the only record is an email inbox, there is nothing to reconcile and no way to prove any number. Fix storage before touching attribution.

  4. 04

    List every event name in the project and look for near-duplicates

    Case differences, tense differences and synonyms are the usual finding, and they are cheap to fix before a year of data is built on them.

  5. 05

    Read the match rate, not the success message

    Mixpanel shows events in the live view within moments. Check that the distinct_id matches the signed-in user rather than a lingering anonymous ID, because that is the failure that quietly breaks every cross-signup funnel.

Contact Form 7 → Mixpanel · prove

How it gets proven — Contact Form 7 → Mixpanel

Source of truth

Whatever you configure to persist submissions — an entries plugin, or your own database table. By default there is nothing to reconcile against.

  • The distinct_id confirmed present on a live submission.
  • Purchase events reconciled per transaction against your billing system, with identity aliasing verified across the signup boundary.
  • Stored submissions confirmed to match the email record for the same period, before any attribution claim is made.

Contact Form 7 → Mixpanel · free audit

What we check in the free audit

  • Count submissions carrying the distinct_id
  • Follow one real conversion end to end
  • Confirm submissions are being stored at all
  • List every event name in the project and look for near-duplicates
  • Read the match rate, not the success message

Checked against

Whatever you configure to persist submissions — an entries plugin, or your own database table. By default there is nothing to reconcile against.

Get my free conversion tracking audit

Free30 minutesNo obligation

Contact Form 7 → Mixpanel · when not to buy

When you don't need this — Contact Form 7 → Mixpanel

  • Measure identifier coverage yourself first — pull your last hundred submissions and count how many carry the distinct_id.
  • If you are on Contact Form 7 and serious about attribution, moving to a form plugin that stores entries is often cheaper than working around the one that does not. We will say so rather than bill for the workaround.
  • If you already have the same events in a warehouse and nobody is running product analysis on them, adding Mixpanel adds a second source of truth rather than an answer.

Contact Form 7 → Mixpanel · what we deliver

What gets built — Contact Form 7 → Mixpanel

  • Identifier capture into Contact Form 7

    Hidden field populated from a first-party cookie, plus a storage layer so the submission and its identifier survive past the email. The wpcf7_before_send_mail hook is where both happen.

  • Event source: the wpcf7_mail_sent hook

    Fire server-side from PHP. The browser-side wpcf7mailsent DOM event exists and is commonly used, but it depends on the visitor's browser executing correctly and on the AJAX response arriving — the server hook does not.

  • Dispatch to Mixpanel

    The Mixpanel ingestion API, posted server-side from your backend with the distinct_id and event properties.

  • Reversals where they exist

    Nothing to reverse. Spam filtering before the send is the equivalent concern.

Written guarantee

95%+ tracking accuracy

Measured against Whatever you configure to persist submissions — an entries plugin, or your own database table. By default there is nothing to reconcile against.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Contact Form 7 → Mixpanel questions, answered

Copy the visitor's Mixpanel distinct_id into a hidden field, then send the event server-side from a Contact Form 7 hook using that distinct_id. That keeps the submission on the same profile as the browsing that led to it.

Free · 30 min

Get Contact Form 7 and Mixpanel joined properly

Free30 minutesNo obligation