Blog

Server-Side Tracking for Indian Stores: Fixing GA4 Order Gaps

Server-Side Tracking for Indian Stores: Fixing GA4 Order Gaps: MeraSEO article cover
Key takeaways
  • Before changing any tracking, compare GA4 purchases with your real order list for the same dates. The gap tells you how big the problem is.
  • UPI and card payments often leave the buyer on a bank or app screen, so the thank-you page, and the GA4 purchase event on it, never loads.
  • Server-side purchase events, sent from your order system or a gateway webhook, record the sale even when the buyer never returns to your site.
  • Some gap will remain because of consent choices and ad blockers. Reconcile monthly rather than chasing 100% agreement.

Say your store admin shows 1,000 paid orders for the month and GA4 reports 760. Or GA4 credits a big share of sales to “razorpay.com” as a referral. Both are common on Indian stores, and both come from the same cause: GA4 learns about a purchase only if the buyer’s browser loads a page and runs a tag, and payment flows in India do not always cooperate.

This post explains where the gaps come from, how to measure yours, what server-side tracking fixes, and what it cannot. It assumes a WooCommerce, Shopify or custom store taking payments through Razorpay, PayU, Cashfree or a UPI app.

Compare GA4 purchases with your real order list first

Do not start by installing anything. Start by finding out how big the gap is.

  1. Pick a full recent period, such as the last 30 days, ending at least a few days ago so late payments have settled.
  2. From your store or payment gateway, export orders that were actually paid or confirmed. Count them and add up their value. Exclude cancelled and failed attempts.
  3. In GA4, open Reports and look at purchases (or the Ecommerce purchases report) for the same dates and the same timezone. Note the count and revenue.
  4. Calculate the gap: (real orders − GA4 purchases) ÷ real orders.
  5. Repeat with transaction IDs if you can. List the order IDs missing from GA4. They usually share a payment method or device type, which points to the cause.

A gap of a few percent is normal. A gap that is large, or that is concentrated on one payment method, deserves investigation. Remember also that GA4 and your store may handle currency, tax and refunds differently, so compare like with like. Cash-on-delivery orders need care here: GA4 usually records them when the order is placed, so either count placed COD orders on the store side too, or leave COD out of both counts.

Why buyers never reach the thank-you page after UPI or card payment

The default setup fires the purchase event when the order confirmation page loads. That works if the buyer finishes the payment and the gateway sends them back. In practice:

  • The buyer pays in their UPI app, then stays in the app or closes the browser tab. The payment succeeds but your confirmation page is never opened.
  • A bank page or 3-D Secure screen redirects slowly, and the buyer leaves before the redirect completes.
  • On mobile, the payment app opens in a different browser or in an in-app browser, so the return lands in a session GA4 does not connect to the original visit.
  • Some gateways confirm the payment only through a webhook, and the customer-facing page shows “processing” for a while. Whether the purchase tag fires then depends on your implementation.

In every case the money arrived and the order exists. GA4 simply did not hear about it.

Payment gateways showing up as referral sources

When a buyer is sent to a gateway page and then back to your site, GA4 can record the return as a referral from the gateway domain. The purchase is then credited to “referral / razorpay.com” (or a bank, or a UPI-related domain) instead of the Google ad, email or search visit that actually brought the buyer.

The fix is in GA4’s admin: add the gateway domains to the list of unwanted referrals (Admin, Data streams, your web stream, Configure tag settings) so that GA4 stops treating them as a traffic source. It works only from the date you add it, not on past data. Google describes this setting in its Analytics Help Center. Set it up for each gateway or bank domain you see in your Traffic acquisition report. If you use cross-domain checkout (a hosted checkout on another domain), configure the cross-domain measurement too. Our GA4 and Google Tag Manager setup service covers both.

Orders GA4 never sees, and COD orders it counts too early

Even a perfect tag cannot record a sale that did not happen on your website. Typical examples:

  • Orders placed by phone or taken on WhatsApp and entered manually in the admin.
  • Orders confirmed by a call-back after a form enquiry.
  • Sales on marketplaces such as Amazon or Flipkart, which GA4 on your own site cannot see.

COD is the opposite problem. A COD buyer does reach the thank-you page, so GA4 records the purchase at the moment of ordering, including orders that are later refused at the door. If your COD refusal rate is significant, GA4 revenue will run ahead of the money you actually collect. If you want analytics to reflect delivered COD orders, send the purchase (or a correction) from your server once the courier marks the order delivered, and make sure the browser does not also send it.

Decide which of these belong in your website reporting. For the rest, keep a separate sales sheet and treat GA4 as a measure of website-originated orders, not of all revenue. Our post on reporting results when analytics misses enquiries explains how to present that honestly.

What server-side tracking fixes: purchase events from your server and gateway webhooks

Server-side tracking means the purchase event is sent to GA4 from a server instead of, or as well as, from the buyer’s browser. There are two common routes.

Route 1: Send the event from your order system

When your store marks an order as paid, your server calls the GA4 Measurement Protocol with the transaction ID, value, items and the client ID that was captured at checkout. The event does not depend on the thank-you page loading. This is practical on WooCommerce and custom builds. On Shopify, check what your analytics app or the Google channel app already sends before adding a second purchase event.

Route 2: Use a server-side Google Tag Manager container

A server container receives events from your site and forwards them to GA4 and other platforms. With a custom client it can also accept requests from your own backend. It gives more control, but it is infrastructure you must host, pay for and monitor.

OptionBest forWatch out for
Browser tag onlySmall stores, simple checkout, low gapMisses buyers who never return; depends on page load
Measurement Protocol from order systemStores with a custom or WooCommerce backendNeeds the client ID saved with the order; dedupe against the browser event
Server-side GTM containerSeveral platforms to feed, higher volumesHosting cost, setup and ongoing maintenance

The details that decide whether it works

  • Capture the client ID and session ID at checkout and store them on the order. Without them, the server event cannot be attributed to the original visit.
  • Send one event per order. Use the same transaction ID in both browser and server events and make sure only one is counted, otherwise you will inflate revenue. The same mistake can distort Google Ads, as covered in duplicate conversions.
  • Trigger on a reliable status such as “payment captured” or “order processing”, not on “order created”, which includes abandoned attempts.
  • Test with real small orders on each payment method and check GA4 DebugView and the Realtime report.

Gateway webhooks are the other half. Razorpay, PayU and Cashfree can all notify your server when a payment succeeds. Wiring that to your order status, and then to the tracking event, is integration work that our payment and API integration team handles.

Consent, ad blockers and the gap you cannot close

Server-side does not make tracking invisible or unlimited. If a visitor declines analytics consent, you should not send their data to GA4 as if they had agreed, whatever the technical route. Ad blockers also stop the browser side of tracking, so server-sent purchases recover some, but not all, of what was lost. Treat any claim of “100% accuracy” with suspicion.

Aim for a stable, explainable gap. If GA4 sits within a known range of your real orders and the range does not swing month to month, you can trust the trends even when the absolute count is a little low.

A monthly reconciliation routine

  1. Export confirmed orders and revenue from the store for the month.
  2. Pull GA4 purchases and revenue for the same dates and timezone.
  3. Record the gap and split it by payment method (UPI, card, COD, wallet) and device.
  4. Check the referral report for any new gateway or bank domains and add them to the unwanted referrals list.
  5. Review purchase events for duplicate transaction IDs.
  6. Run the check again after every checkout, gateway or theme change, and before big sale periods.

Better measurement also feeds better decisions on checkout fixes; our e-commerce conversion rate optimization work starts with numbers you can trust.

Frequently asked questions

What is server-side tracking?

Server-side tracking sends events such as purchases to analytics or ad platforms from a server instead of relying only on the visitor’s browser. For a store, that usually means your order system or payment webhook reports a paid order directly to GA4, so the sale is recorded even if the buyer never returns to the thank-you page.

Why is GA4 showing fewer orders than my store?

Common reasons are buyers leaving after UPI or card payment before the confirmation page loads, ad blockers, declined consent, phone or WhatsApp orders entered manually, and tags firing on the wrong event. Compare GA4 with paid orders for the same dates, then look at which payment methods are missing.

Why does Razorpay show as a referral in GA4?

When a buyer is sent to the gateway and then back to your site, GA4 records the return as a referral from the gateway domain, and that referral can take credit for the purchase. Add the gateway domains to the unwanted referrals list in your web data stream’s tag settings. The fix applies only to new data, not past reports.

Does server-side tracking fix everything?

No. It recovers purchases lost to redirects and slow page loads, and it improves reliability. It cannot record sales made outside your site, and it must still respect visitor consent. Expect a smaller, steadier gap, and keep a monthly reconciliation against real orders.

Find out how many of your orders GA4 is missing

We will compare your GA4 purchases with real orders and set up reliable purchase tracking for your checkout.

Get your tracking checked →

Related Post

Call Now Button