Skip to main content
Salesforce → MixpanelIntegration guide

Connecting Salesforce to Mixpanel

Salesforce holds the opportunity, the amount and the close — the only place the actual revenue outcome is recorded. 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 Salesforce Lead or Opportunity 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

Salesforce deals in Mixpanel: product signals behind the pipeline

Send Salesforce deal stages to Mixpanel using the product user ID stored on the Contact as distinct_id, and key a company group on the Account ID if your plan allows. Send Opportunity Created and Closed Won with Amount, using Opportunity ID plus stage as $insert_id, and keep event time consistent. Attach deals to the account group, not just the signer.

Mixpanel's job here is answering which in-product behavior comes before a deal: a team invite, an integration connected, a usage limit hit. The join is the Contact's product user ID stored on the Salesforce record, sent as Mixpanel's distinct_id so the deal event lands on the same profile as the usage. If your plan includes group analytics, key a company group on the Salesforce Account ID too.

Send stage changes from a Salesforce flow or a scheduled sync: Opportunity Created, then Closed Won with Amount as a property and the Opportunity ID plus stage as $insert_id. Close dates in Salesforce are dates, often edited by reps, so choose whether Mixpanel's event time is the stage-change timestamp or the close date and keep it consistent. Check whether Mixpanel offers a Salesforce connector on your plan before building a sync.

The common mistake is sending the deal on the person who signed the contract, a buyer who never used the product. Attach it to the account group as well, or the analysis will conclude that customers who close never log in.

Salesforce → Mixpanel · what breaks

Why this join usually fails — Salesforce → Mixpanel

  1. 01

    The distinct_id never reaches Salesforce

    Lead conversion is where identifiers die. A custom field on Lead that has no mapped counterpart on Contact or Opportunity is silently discarded when the Lead converts, and nobody notices until months of data are unattributable.

  2. 02

    The identifier is lost at lead conversion

    This one failure explains most broken Salesforce attribution. The data is captured correctly, then thrown away by a mapping nobody configured.

  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.

Salesforce → Mixpanel · the fix

What working looks like — Salesforce → Mixpanel

  • The distinct_id on every opportunity

  • Conversions arriving in Mixpanel

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

  • Reconciled against the source

Salesforce → Mixpanel · architecture

How Salesforce and Mixpanel actually connect

  1. 1

    Salesforce holds the truth

    The opportunity carries the amount, stage and close date. Because Leads convert into Contacts, Accounts and Opportunities, the identifier must be mapped through the conversion or it is dropped exactly at the moment the record becomes valuable.

  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 Salesforce Lead or Opportunity.

  4. 4

    The event source decides reliability

    Fire on the transition into Closed Won, carrying the amount and the identifier. Note that Salesforce's own advertising integrations vary in what they support — build on the record, not on a connector that might change.

  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.

Salesforce → Mixpanel · normal or broken

Working vs. broken, side by side — Salesforce → Mixpanel

Normal, not a fault

  • The distinct_id present on the opportunity

  • Sent from a Salesforce flow, Apex trigger or scheduled export on StageName change

  • 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

    Lead conversion is where identifiers die. A custom field on Lead that has no mapped counterpart on Contact or Opportunity is silently discarded when the Lead converts, and nobody notices until months of data are unattributable.

  • Sent from the browser

    This one failure explains most broken Salesforce attribution. The data is captured correctly, then thrown away by a mapping nobody configured.

  • 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

Salesforce → Mixpanel · diagnose

Diagnostic order — Salesforce → Mixpanel

  1. 01

    Count opportunitys carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Convert a test Lead and inspect the resulting Opportunity

    If the identifier is not on the Opportunity, the field mapping is missing. This takes five minutes and rules out the most likely cause outright.

  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.

Salesforce → Mixpanel · prove

How it gets proven — Salesforce → Mixpanel

Source of truth

A Salesforce report of Closed Won opportunities for the same window, by close date.

  • The distinct_id confirmed present on a live opportunity.
  • Purchase events reconciled per transaction against your billing system, with identity aliasing verified across the signup boundary.
  • A test lead converted end to end with the identifier confirmed present on the resulting opportunity.

Salesforce → Mixpanel · free audit

What we check in the free audit

  • Count opportunitys carrying the distinct_id
  • Follow one real conversion end to end
  • Convert a test Lead and inspect the resulting Opportunity
  • List every event name in the project and look for near-duplicates
  • Read the match rate, not the success message

Checked against

A Salesforce report of Closed Won opportunities for the same window, by close date.

Get my free conversion tracking audit

Free30 minutesNo obligation

Salesforce → Mixpanel · when not to buy

When you don't need this — Salesforce → Mixpanel

  • Measure identifier coverage yourself first — pull your last hundred opportunitys and count how many carry the distinct_id.
  • If your Salesforce instance is heavily customized and administered by another team, scope their availability before commissioning this — the build is usually blocked on admin access rather than on the tracking work.
  • 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.

Salesforce → Mixpanel · what we deliver

What gets built — Salesforce → Mixpanel

  • Identifier capture into Salesforce

    Custom field on Lead, matching custom field on Contact and Opportunity, and the field mapping configured so conversion carries it across. Verify by converting a test lead and reading the resulting opportunity.

  • Event source: a Salesforce flow, Apex trigger or scheduled export on StageName change

    Fire on the transition into Closed Won, carrying the amount and the identifier. Note that Salesforce's own advertising integrations vary in what they support — build on the record, not on a connector that might change.

  • Dispatch to Mixpanel

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

  • Reversals where they exist

    An opportunity moved back out of Closed Won can be retracted, and enterprise pipelines do this often enough to be worth wiring.

Written guarantee

95%+ tracking accuracy

Measured against A Salesforce report of Closed Won opportunities for the same window, by close date.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Salesforce → Mixpanel questions, answered

Store your product user ID on the Salesforce Contact and send deal events with that as distinct_id. Use a group keyed on Account ID if your plan includes group analytics.

Free · 30 min

Get Salesforce and Mixpanel joined properly

Free30 minutesNo obligation