Skip to main content
Razorpay → MixpanelIntegration guide

Connecting Razorpay to Mixpanel

Razorpay is Indian payments, where UPI dominates and the flow moves through a separate app on the customer's phone. 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 Razorpay payment 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

Razorpay to Mixpanel: distinct_id in order notes survives UPI

Write Mixpanel's distinct_id into the Razorpay order or subscription notes at creation and send the payment event from the webhook, using the Razorpay payment ID as $insert_id. Send Subscriptions renewals as their own event with plan and cycle number, not as first purchases, and send failed payments with method and error reason so bank failures are not mistaken for churn.

For a subscription or app business in India, Mixpanel is where you look at who pays, and Razorpay is where the payment happens. The join is the distinct_id: write it into the notes when your server creates the Razorpay order or subscription, and send the payment event from the webhook with that value. Without it, a UPI customer who approved in their banking app and never came back has a payment no profile owns.

If you use Razorpay Subscriptions, the first payment and each renewal arrive as separate webhook events; check the exact event names in your dashboard. Send renewals as their own Mixpanel event with the plan and cycle number, not as another first purchase, or retention reports show every subscriber converting monthly. Check whether notes set on the subscription appear in each charge's payload; if not, look up the distinct_id from the subscription ID on your side.

Use the Razorpay payment ID as $insert_id. Send failed payments too, with the method and the error reason Razorpay returns, because UPI mandates and collect requests fail for reasons outside your product. Without them, a product team will conclude that a pricing change caused churn that a bank actually caused.

Razorpay → Mixpanel · what breaks

Why this join usually fails — Razorpay → Mixpanel

  1. 01

    The distinct_id never reaches Razorpay

    UPI sends the customer into a banking app to approve, and on mobile that app switch frequently ends the browser session. The payment completes and the browser that started it may never come back to fire anything.

  2. 02

    UPI app switching ends the browser session

    The customer leaves the browser for a banking app to approve, and on many devices does not return. Payment succeeds, page never fires — and UPI is the majority method in this market.

  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.

Razorpay → Mixpanel · the fix

What working looks like — Razorpay → Mixpanel

  • The distinct_id on every payment

  • Conversions arriving in Mixpanel

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

  • Reconciled against the source

Razorpay → Mixpanel · architecture

How Razorpay and Mixpanel actually connect

  1. 1

    Razorpay holds the truth

    Razorpay separates authorised and captured. Auto-capture is common but not universal, and reporting on authorised inflates the figure by whatever fails to capture.

  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 Razorpay payment.

  4. 4

    The event source decides reliability

    Fire on captured. The app-switch behaviour of UPI makes any browser-based trigger unreliable in a way that is much more pronounced here than on card markets.

  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.

Razorpay → Mixpanel · normal or broken

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

Normal, not a fault

  • The distinct_id present on the payment

  • Sent from the Razorpay payment.captured webhook

  • 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

    UPI sends the customer into a banking app to approve, and on mobile that app switch frequently ends the browser session. The payment completes and the browser that started it may never come back to fire anything.

  • Sent from the browser

    The customer leaves the browser for a banking app to approve, and on many devices does not return. Payment succeeds, page never fires — and UPI is the majority method in this market.

  • 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

Razorpay → Mixpanel · diagnose

Diagnostic order — Razorpay → Mixpanel

  1. 01

    Count payments carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Compare captured payments against confirmation-page loads on mobile

    Split by payment method. The UPI gap will be much larger than the card gap.

  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.

Razorpay → Mixpanel · prove

How it gets proven — Razorpay → Mixpanel

Source of truth

Razorpay's captured payments by date, net of refunds.

  • The distinct_id confirmed present on a live payment.
  • Purchase events reconciled per transaction against your billing system, with identity aliasing verified across the signup boundary.
  • A UPI payment approved in the banking app without returning to the site, confirmed to report.

Razorpay → Mixpanel · free audit

What we check in the free audit

  • Count payments carrying the distinct_id
  • Follow one real conversion end to end
  • Compare captured payments against confirmation-page loads on mobile
  • List every event name in the project and look for near-duplicates
  • Read the match rate, not the success message

Checked against

Razorpay's captured payments by date, net of refunds.

Get my free conversion tracking audit

Free30 minutesNo obligation

Razorpay → Mixpanel · when not to buy

When you don't need this — Razorpay → Mixpanel

  • Measure identifier coverage yourself first — pull your last hundred payments and count how many carry the distinct_id.
  • If your Razorpay volume is card-only, the app-switch problem largely disappears.
  • 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.

Razorpay → Mixpanel · what we deliver

What gets built — Razorpay → Mixpanel

  • Identifier capture into Razorpay

    Pass the click identifier into the Razorpay order's notes when your server creates the order. Notes survive to the payment and to the webhook regardless of what the browser did.

  • Event source: the Razorpay payment.captured webhook

    Fire on captured. The app-switch behaviour of UPI makes any browser-based trigger unreliable in a way that is much more pronounced here than on card markets.

  • Dispatch to Mixpanel

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

  • Reversals where they exist

    Refunds are exposed and carry the original notes.

Written guarantee

95%+ tracking accuracy

Measured against Razorpay's captured payments by date, net of refunds.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Razorpay → Mixpanel questions, answered

Put the distinct_id in the Razorpay order or subscription notes and send the event from the webhook with that value.

Free · 30 min

Get Razorpay and Mixpanel joined properly

Free30 minutesNo obligation