Skip to main content
Razorpay → MatomoIntegration guide

Connecting Razorpay to Matomo

Razorpay is Indian payments, where UPI dominates and the flow moves through a separate app on the customer's phone. Matomo can be self-hosted with no third party in the chain, which makes it the one analytics destination where the data genuinely never leaves infrastructure you control. The join between them succeeds or fails on one thing: whether the first-party visitor ID reaches the Razorpay payment before the conversion happens, because Matomo can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Razorpay orders in self-hosted Matomo, including the UPI ones

UPI buyers often skip Matomo's confirmation-page order tracking. Read the visitor ID from Matomo's first-party cookie at Razorpay order creation and store it in the notes, then on payment.captured call the Tracking HTTP API with that visitor ID, rupee revenue and the Razorpay order ID as ecommerce order ID. Add payment method as a custom dimension.

Matomo's ecommerce order is normally tracked by the browser on the confirmation page, and UPI buyers often never get there. For a Razorpay business, that makes Matomo's conversion rate wrong in a specific, predictable way: card and netbanking orders appear, UPI orders on mobile largely do not. Self-hosting Matomo, often chosen to keep visitor data in infrastructure you control in India, does nothing about that by itself.

Record the order from the server instead. Read the visitor ID from Matomo's first-party cookie when your server creates the Razorpay order and store it in the order notes; on payment.captured, call Matomo's Tracking HTTP API with that visitor ID, the order's revenue in rupees and the Razorpay order ID as the ecommerce order ID. Overriding the visit time or visitor IP from a server request requires an auth token, so set that up in advance. The order ID also stops a card buyer who does return to the page from being counted twice.

Add the payment method as a custom dimension so you can see the UPI share recovered. Because Matomo is on your own server, check that the webhook handler can reach the tracker endpoint and that a failed request is retried, not dropped.

Razorpay → Matomo · what breaks

Why this join usually fails — Razorpay → Matomo

  1. 01

    The first-party visitor 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

    Owning the pipeline means owning the outage

    The advantage is that nothing blocks it. The cost is that when the tracking database fills or falls behind on a weekend, the data is gone and no vendor is paging anyone. Hosted tools fail more visibly.

  4. 04

    Nothing reconciles afterwards

    Matomo exposes raw visit logs, so you can inspect the actual hit rather than an aggregate. Check the log, and check ingestion lag alongside it.

Razorpay → Matomo · the fix

What working looks like — Razorpay → Matomo

  • The first-party visitor ID on every payment

  • Conversions arriving in Matomo

    The event lands in your own database and is queryable directly, including the raw log, which most analytics products do not expose.

  • Reconciled against the source

Razorpay → Matomo · architecture

How Razorpay and Matomo 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

    Matomo needs a click to match

    The site ID, the visitor identifier and the event or ecommerce order. Self-hosted instances additionally need the tracker endpoint reachable and the database keeping up, which hosted tools do not fail at.

  3. 3

    The identifier is the bridge

    The first-party visitor 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

    Matomo deduplicates ecommerce orders on order ID. Without one, a refreshed confirmation page records a second order.

Razorpay → Matomo · normal or broken

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

Normal, not a fault

  • The first-party visitor ID present on the payment

  • Sent from the Razorpay payment.captured webhook

  • Deduplicated correctly

    Matomo deduplicates ecommerce orders on order ID. Without one, a refreshed confirmation page records a second order.

  • Reconciles with the source

Actually broken

  • The first-party visitor 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

    The advantage is that nothing blocks it. The cost is that when the tracking database fills or falls behind on a weekend, the data is gone and no vendor is paging anyone. Hosted tools fail more visibly.

  • Nobody has reconciled it

Razorpay → Matomo · diagnose

Diagnostic order — Razorpay → Matomo

  1. 01

    Count payments carrying the first-party visitor 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

    Check tracker reachability and database lag before debugging any tag

    On self-hosted analytics the answer is infrastructure more often than instrumentation.

  5. 05

    Read the match rate, not the success message

    Matomo exposes raw visit logs, so you can inspect the actual hit rather than an aggregate. Check the log, and check ingestion lag alongside it.

Razorpay → Matomo · prove

How it gets proven — Razorpay → Matomo

Source of truth

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

  • The first-party visitor ID confirmed present on a live payment.
  • Orders reconciled against the Matomo ecommerce log with order-ID deduplication verified.
  • A UPI payment approved in the banking app without returning to the site, confirmed to report.

Razorpay → Matomo · free audit

What we check in the free audit

  • Count payments carrying the first-party visitor ID
  • Follow one real conversion end to end
  • Compare captured payments against confirmation-page loads on mobile
  • Check tracker reachability and database lag before debugging any tag
  • 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 → Matomo · when not to buy

When you don't need this — Razorpay → Matomo

  • Measure identifier coverage yourself first — pull your last hundred payments and count how many carry the first-party visitor ID.
  • If your Razorpay volume is card-only, the app-switch problem largely disappears.
  • If you have no privacy or ownership requirement and no team to run it, a hosted product removes the only real cost of this one.

Razorpay → Matomo · what we deliver

What gets built — Razorpay → Matomo

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

    The Matomo HTTP Tracking API, posted server-side from your order system.

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

Matomo tracks orders on the confirmation page, which UPI buyers often never reach. Send the order from the payment.captured webhook through the Tracking HTTP API with the visitor ID stored in the order notes.

Free · 30 min

Get Razorpay and Matomo joined properly

Free30 minutesNo obligation