Razorpay showing as referral in GA4? How to fix it
If Razorpay, PayU, CCAvenue or a bank's OTP page appears in your GA4 traffic report with a big share of purchases, GA4 is crediting the sale to the payment gateway instead of the Google ad, Instagram post or email that brought the buyer. The fix is GA4's List unwanted referrals setting, plus a quick check on your checkout redirect. It takes about 20 minutes and changes how every future sale is attributed.
Why payment gateways steal credit in GA4
A typical Indian checkout leaves your domain at the moment of payment. The shopper clicks Pay, lands on a hosted gateway page or a bank's 3-D Secure OTP screen, and is then sent back to your thank-you page.
When they return, the browser passes the gateway's domain as the referrer. GA4 sees a new referral source, can start a fresh session, and credits the purchase event to something like api.razorpay.com / referral. Your Meta campaign, which actually drove the click, loses the conversion.
You can see the damage quickly. In GA4, open Reports → Acquisition → Traffic acquisition, switch the dimension to Session source / medium, and add Key events or Purchase revenue. If a gateway or bank domain is in your top 10 by revenue, you have the problem.
Which domains to look for
Look for anything that is clearly part of checkout rather than a real traffic source. On Indian sites we commonly see:
| Type | Example domains to search for |
|---|---|
| Payment gateways | razorpay.com, payu.in, ccavenue.com, cashfree.com |
| Wallets and UPI apps | paytm, phonepe |
| Payment orchestration | juspay |
| Bank OTP / 3-D Secure pages | domains containing the bank's name, often with "acs" or "secure" |
| International | checkout.stripe.com, paypal.com |
Treat this list as a starting point. Copy the exact domains from your own Session source report, because gateways use different subdomains and your integration decides which one appears.
How to set up List unwanted referrals
Google's help page on identifying unwanted referrals gives the path. You need Editor access or above on the property.
- Go to Admin → Data collection and modification → Data streams.
- Open your web data stream.
- Click Configure tag settings, then Show all.
- Choose List unwanted referrals.
- Add one condition per domain. Use a "contains" style match on the root domain (for example
razorpay.com) so all its subdomains are covered. - Save.
Behind the scenes, GA4 adds ignore_referrer=true to events that match, so the gateway is not reported as a source. You can add up to 50 conditions per web stream, and conditions work with OR logic.
Two limits to know
- It is not retroactive. Google's own example shows a session recorded before you added the domain stays attributed to it. Your history stays messy; only new data is fixed. Note the date you made the change in your reporting deck.
- It needs the Google tag on the return page. The setting works on pages where the Google tag runs. If your thank-you page is a bare gateway callback without the tag, fix that first.
If you recently moved your Google tag into a GTM container, confirm the tag still fires on the order-confirmation page. Our checklist for a Google tag upgraded to a GTM container covers this.
Unwanted referrals vs cross-domain tracking
These solve different problems, and teams mix them up.
- Unwanted referrals is for domains you don't own and don't track, like a payment gateway.
- Cross-domain measurement is for domains you own and tag, such as
brand.inandshop.brand.inon separate platforms. Google covers it in its cross-domain measurement guide.
If your store runs on one domain and your booking engine on another that you control, you want cross-domain, not an exclusion.
Sanity checks after the change
Give it 3 to 5 days of data, then check:
- The gateway domain no longer appears in Session source / medium for new sessions.
- Direct has not jumped by the same amount. If it has, the original source isn't being carried back. Check that UTMs and gclid survive your checkout redirect, and that the return URL isn't stripping the query string.
- Purchase counts match your backend. If GA4 shows fewer orders than Shopify or your order database, you have a separate tag-firing problem, not a referral one.
A worked example: a Pune D2C brand selling ₹1,499 kurtas sees 180 purchases in a week, 62 of them under api.razorpay.com / referral. After the fix, most of those 62 should reappear under the real sources, for example paid social and Google CPC. If 40 move to Direct instead, the redirect is the leak.
For other channel-attribution gaps, see what GA4 does and doesn't catch in its AI Assistant channel. If you manage product links and streams through the new admin hub, our GA4 Data Manager guide explains where these settings now sit.
What to do this week
- [ ] Pull Session source / medium with purchase revenue for the last 30 days.
- [ ] List every gateway, wallet and bank OTP domain that appears.
- [ ] Add each root domain under List unwanted referrals in your web stream.
- [ ] Confirm the Google tag fires on the thank-you page.
- [ ] Record the change date so later reports explain the attribution shift.
- [ ] After 3–5 days, check whether Direct rose and whether GA4 purchases match your backend.
FAQ
Will this fix my old reports?
No. The setting applies to new data only. Earlier sessions stay credited to the gateway.
Do I need this if I use Razorpay's embedded checkout?
Possibly not. If payment happens in a pop-up or iframe and the shopper never leaves your page, there may be no referral. Check your report: if the gateway doesn't appear, you don't need the exclusion.
Should I exclude Google or Facebook domains too?
No. Those are real traffic sources. Only exclude domains that are part of your checkout or login flow.