Skip to main content
Razorpay → GA4Integration guide

Connecting Razorpay to GA4

Razorpay is Indian payments, where UPI dominates and the flow moves through a separate app on the customer's phone. GA4 is where the business goes to understand what happened, which makes an unattributed conversion there expensive in decisions rather than in ad spend. The join between them succeeds or fails on one thing: whether the GA4 client_id reaches the Razorpay payment before the conversion happens, because GA4 can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Razorpay to GA4: recover UPI purchases the page never saw

Store GA4's client_id and session_id in the Razorpay order notes at order creation, then send purchase through Measurement Protocol from the payment.captured webhook, filling UPI sessions that never return. Convert paise to rupees with currency INR, send every purchase from the webhook and remove the browser purchase tag, and send refunds with the same transaction_id.

In GA4 the Razorpay gap shows up as purchases missing from mobile sessions that ended in a UPI app and never returned. Store the client_id and session_id in the Razorpay order's notes when your server creates the order, then send purchase through Measurement Protocol from the payment.captured webhook. That fills exactly the hole the confirmation page leaves, and the session's original source and medium carry through.

Razorpay amounts arrive in the smallest currency unit, paise for rupees, so an order of 1,499 rupees appears as 149900. Divide before sending value, or GA4 revenue will be a hundred times too high. Send currency INR and let GA4 convert if the property reports in another currency.

Because the confirmation page still fires for card and netbanking buyers who do return, decide which side owns purchase. The cleanest rule for this pair is to send every purchase from the webhook and remove the browser purchase tag, since GA4 will not deduplicate them. Refunds can go back as GA4 refund events with the same transaction_id, and payment_method from the webhook makes a useful custom dimension for comparing UPI and card conversion by channel.

Razorpay → GA4 · what breaks

Why this join usually fails — Razorpay → GA4

  1. 01

    The GA4 client_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

    Everything lands under (direct)/(none)

    The classic Measurement Protocol symptom, and it always means the same thing: the client_id was missing or wrong, so GA4 had no session to attach the event to and invented a new user.

  4. 04

    Nothing reconciles afterwards

    GA4 DebugView shows events arriving with their parameters, and Realtime confirms the user and session they attached to. Neither tells you whether you are double-counting — for that, compare GA4's conversion count against the source system's record for the same window.

Razorpay → GA4 · the fix

What working looks like — Razorpay → GA4

  • The GA4 client_id on every payment

  • Conversions arriving in GA4

    Conversions appear in GA4 attributed to the original session's source and medium, so acquisition reporting reflects what actually drove revenue.

  • Reconciled against the source

Razorpay → GA4 · architecture

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

    GA4 needs a click to match

    GA4 needs the client_id to attach a server event to the user and session that produced the click. Without it there is no attribution to inherit and the event is orphaned.

  3. 3

    The identifier is the bridge

    The GA4 client_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

    GA4 has no built-in deduplication for Measurement Protocol. If the browser also sends the event, it counts twice. The only reliable approach is to decide per event which side sends it, and enforce that decision — GA4 will not protect you from your own duplicates.

Razorpay → GA4 · normal or broken

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

Normal, not a fault

  • The GA4 client_id present on the payment

  • Sent from the Razorpay payment.captured webhook

  • Deduplicated correctly

    GA4 has no built-in deduplication for Measurement Protocol. If the browser also sends the event, it counts twice. The only reliable approach is to decide per event which side sends it, and enforce that decision — GA4 will not protect you from your own duplicates.

  • Reconciles with the source

Actually broken

  • The GA4 client_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 classic Measurement Protocol symptom, and it always means the same thing: the client_id was missing or wrong, so GA4 had no session to attach the event to and invented a new user.

  • Nobody has reconciled it

Razorpay → GA4 · diagnose

Diagnostic order — Razorpay → GA4

  1. 01

    Count payments carrying the GA4 client_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 whether server events carry a session and a source

    In GA4 Realtime or DebugView, find the event and look at its session and traffic source. A brand-new user with no source on every server event is the missing-client_id signature.

  5. 05

    Read the match rate, not the success message

    GA4 DebugView shows events arriving with their parameters, and Realtime confirms the user and session they attached to. Neither tells you whether you are double-counting — for that, compare GA4's conversion count against the source system's record for the same window.

Razorpay → GA4 · prove

How it gets proven — Razorpay → GA4

Source of truth

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

  • The GA4 client_id confirmed present on a live payment.
  • Server events confirmed in DebugView attaching to an existing session with the original traffic source intact.
  • A UPI payment approved in the banking app without returning to the site, confirmed to report.

Razorpay → GA4 · free audit

What we check in the free audit

  • Count payments carrying the GA4 client_id
  • Follow one real conversion end to end
  • Compare captured payments against confirmation-page loads on mobile
  • Check whether server events carry a session and a source
  • 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 → GA4 · when not to buy

When you don't need this — Razorpay → GA4

  • Measure identifier coverage yourself first — pull your last hundred payments and count how many carry the GA4 client_id.
  • If your Razorpay volume is card-only, the app-switch problem largely disappears.
  • GA4 is reporting, not bidding. If your problem is ad platform optimization, fix the ad platform destination first — GA4 will not change what any campaign does.

Razorpay → GA4 · what we deliver

What gets built — Razorpay → GA4

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

    Measurement Protocol events with the client_id, session_id and the correct measurement ID and API secret, sent server-side.

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

Razorpay reports amounts in paise. Divide by 100 before setting the purchase value.

Free · 30 min

Get Razorpay and GA4 joined properly

Free30 minutesNo obligation