Server-Side Purchase Tracking for WooCommerce: Stop Ad Blockers Eating Your Revenue Data

July 7, 2026

Run this test: count yesterday’s WooCommerce orders, then count yesterday’s GA4 purchases. On a typical store the gap is 15–40%. That gap is not a bug in your setup — it is the browser. Ad blockers, Safari’s ITP, brave privacy defaults, flaky mobile connections and customers who never return to the thank-you page all erase client-side events after the money has already arrived.

Why the browser loses events

What server-side tracking actually does

Instead of hoping the customer’s browser reports the sale, your server reports it: when WooCommerce records the order, your site sends the purchase directly to Google’s Measurement Protocol (and, if you advertise there, to Meta’s Conversions API or TikTok’s Events API). No browser, no blocker, no race. The order happened — the event fires.

The deduplication problem (and its clean solution)

If the browser event and the server event both arrive, you would double-count. The fix is a shared identifier: send the same transaction/event ID from both paths and the platform keeps only one copy. GA4 deduplicates purchases on transaction_id; Meta and TikTok deduplicate on event_id. The natural choice for both is the WooCommerce order number. Get this wrong and server-side tracking makes your data worse, not better — it is the one part you must not improvise.

What server-side tracking does NOT fix

Honesty matters here, because “server-side” gets sold as magic:

Adding it to WooCommerce — three routes

  1. GA4 Measurement Protocol from your own server — a hook on order completion posts the purchase JSON with your API secret. Cheapest and fully self-contained; you must handle dedup IDs, refunds and consent gates yourself.
  2. A server-side GTM container (Cloud Run or similar) — the most flexible and the most operationally expensive: you run infrastructure (~$45+/month) and still need a correct client feed.
  3. A plugin that ships it turnkey — order-status-driven events, transaction-ID dedup against the browser, refund tracking, consent-gated customer data, multi-platform (GA4 + Meta CAPI + TikTok). This is the sane default for most stores.

Refunds: the forgotten half

Revenue accuracy cuts both ways. If purchases flow in but refunds never do, your GA4 revenue drifts upward forever. Whatever route you choose, wire WooCommerce refunds to GA4’s refund event with the same transaction ID — your ROAS math depends on it.

TrackPilot handles everything in this guide automatically — a spec-compliant GA4 dataLayer for WooCommerce with Consent Mode v2, purchase deduplication and a built-in debugger. See TrackPilot →

Liked this? The plugins do the heavy lifting.

Browse the plugins