Razorpay conversion tracking: tie every sale back to the link that made it
Razorpay knows exactly which orders were paid for. Your links know exactly who clicked. Here is how to join the two so every campaign gets a rupee figure instead of a click count.
Razorpay conversion tracking connects a paid Razorpay order back to the specific short link, campaign and channel that brought the buyer, by passing a click identifier through checkout and confirming the sale server-side from Razorpay’s webhook, so revenue is attributed from a payment that actually settled rather than from a browser event.
Most Indian stores run on Razorpay, and most of them can tell you their revenue to the rupee. Ask which Instagram reel, WhatsApp broadcast or creator post produced that revenue, though, and the answer gets vague fast. The payment data and the marketing data live in two different places and nobody ever introduced them.
That gap is worth closing, because the payment gateway is the only system in your stack that knows the truth. A click can be a bot. A page view can be a misfire. A settled Razorpay payment is money that arrived. If you attribute from there, your numbers stop being flattering and start being useful.
Why browser-side tracking quietly undercounts
The usual setup fires a conversion from a thank-you page: the buyer pays, gets redirected back, a script runs, a sale is recorded. It works right up until it does not. Buyers close the tab the moment the UPI app says success. They pay on one device and never return to the browser tab on another. Ad blockers and privacy modes strip the script. Some UPI flows return the user through a route your thank-you page never sees.
Every one of those is a real sale that your dashboard never counted. The damage is not just a smaller number — it is a biased one, because the losses are not spread evenly. Mobile UPI buyers drop off far more than desktop card buyers, so the channels that send mobile traffic get systematically undersold, and you end up cutting spend on the thing that was working.
Let the webhook be the source of truth
Razorpay will tell your server directly when a payment succeeds, through a webhook, without depending on the buyer’s browser doing anything at all. The buyer can close the tab, lose signal, or switch phones — the webhook still fires. That makes it the right place to record a conversion.
The pattern is straightforward. When someone taps your short link, a click identifier is set. That identifier travels with them into checkout and is attached to the Razorpay order as a note. When the payment webhook arrives, it carries that note back to you, and you record the sale against the original click. Nothing about it depends on client-side JavaScript surviving the round trip. This is the same server-side idea covered in pixel versus postback tracking, applied to a specific gateway.
What to attach to the order
Razorpay orders accept a notes object. Keep what you put there minimal and non-personal — it should be enough to join the sale to a click, and nothing more.
| Field | What it carries | Why it matters |
|---|---|---|
| Click id | The identifier set when the short link was opened | The join key. Without it there is nothing to attribute to |
| Campaign | The campaign name you used on the link | Lets you roll many links up into one campaign total |
| Channel | Instagram, WhatsApp, newsletter, a creator’s name | The comparison you actually want to make at month end |
| Order amount | Already on the Razorpay payload | Turns conversions into revenue, so channels rank by rupees |
Verify the webhook before you trust it
A webhook endpoint is a public URL, which means anyone can post to it. Razorpay signs every request; check that signature on arrival and reject anything that fails. Skipping this step means a stranger can invent sales in your dashboard, and you will make budget decisions on fiction.
Handle repeats too. Gateways retry when they do not get a clean response, so the same payment can arrive more than once. Record against the Razorpay payment id and ignore a second delivery of an id you already have, or one good sale becomes three.
Refunds are part of the number
A channel that drives a lot of orders and a lot of refunds is not the channel it appears to be. Razorpay sends refund events on the same webhook, so subtract them. Attribution that only ever counts upward will eventually recommend the discount-hunting audience that returns half of what it buys.
What this gets you
Once the loop is closed, every link in link analytics carries a revenue figure beside its click count, and the comparison you have wanted becomes trivial: this reel earned more than that broadcast, this creator outperformed that one, this campaign paid for itself and that one did not.
The setup is a one-time job, and it is documented on the Razorpay conversion tracking page. From then on the answer to “which link made the sale” stops being a guess — see which link made the sale for how that changes the way you plan.
Found this useful? Tell Google to show you more of it.
Add us as a preferred sourceRelated guides
Put this into practice
Create smart short links that open the right app, with analytics built in. No credit card required.
Start free