WooCommerce tracking

WooCommerce Conversion Tracking: GA4, Meta CAPI & Server-Side

This is for WooCommerce store owners whose ad platforms report fewer sales than WooCommerce does, or the same sale twice. WordPress gives you a lot of freedom, which also means plugins, caching and off-site payment gateways can each break tracking in their own way. I build a clean dataLayer, a GTM setup that reads it, and a server-side feed so purchases still count when the browser doesn't cooperate.

WooCommerce · Ecommerce
  • Reliable GA4 ecommerce dataLayer, usually via GTM4WP or Stape's plugin
  • Purchases captured even when customers never return from the payment gateway
  • Caching and script-optimisation plugins configured so they don't break tags
  • Meta CAPI and Google Ads deduplicated against the WooCommerce order ID
Quick answer

Proper WooCommerce conversion tracking means a plugin-generated ecommerce dataLayer read by Google Tag Manager, a purchase event on the order-received page that fires only once, a server-side purchase sent from WooCommerce order data for off-site payment gateways, and caching rules that leave cart, checkout and tag scripts alone.

Tracking flow

How tracking works on WooCommerce

The events I set up on WooCommerce, and where each one is sent.

Why it breaks

Why WooCommerce tracking goes wrong

Redirect payment gateways lose purchases

Gateways that send the customer to an external payment page rely on them coming back to the order-received page. Many don't, so the browser purchase tag never fires even though the order is paid.

Caching and JS optimisation break tags

Page caching, 'delay JavaScript' and file-combining features can stop GTM loading until a click, or serve a cached page with someone else's cart values in the dataLayer.

Too many plugins sending the same event

It's common to find the official Meta plugin, Google for WooCommerce, Site Kit and a GTM plugin all installed at once. Each may send its own purchase, so platforms double-count.

Block checkout vs older plugins

Newer WooCommerce stores use the block-based Cart and Checkout. Tracking plugins or custom code written for the older shortcode checkout can miss checkout steps or fire them at the wrong time.

Refreshes and revisits re-fire purchases

If the order-received page is reloaded or reopened from an email link, a naive purchase tag sends the order again unless it's guarded by the order ID.

What I set up

My WooCommerce tracking setup

dataLayer and GTM

  • WooCommerce ecommerce dataLayer via GTM4WP or the Stape plugin
  • GA4 events from product view through purchase
  • AJAX add-to-cart on shop and category pages handled
  • Purchase fired once per order ID
  • Removal of duplicate tracking plugins and hard-coded tags

Server-side tracking

  • Server GTM container on Stape or Google Cloud
  • Stape WordPress plugin for first-party loader and purchase webhooks
  • Meta Conversions API with hashed billing email and phone
  • TikTok Events API for checkout and purchase
  • Custom tracking subdomain

Ads and consent

  • Google Ads purchase conversion with value and order ID
  • Enhanced conversions from checkout data
  • Consent Mode v2 connected to your cookie banner plugin
  • Advice on keeping or replacing the official Meta and Google plugins

Performance and QA

  • Caching and optimisation plugin exclusions for GTM and checkout
  • Test orders through each payment gateway you use
  • Pixel vs CAPI deduplication check in Events Manager
  • Revenue reconciliation against WooCommerce orders
  • Written event map and handover call
Event map

Events I track on WooCommerce

EventWhen it firesSent to
view_item_listShop, category or search results page loadsGA4
view_item / ViewContentSingle product page loadsGA4, Meta Pixel + CAPI, TikTok
add_to_cart / AddToCartAdd to cart clicked, including AJAX adds on archive pagesGA4, Meta Pixel + CAPI, TikTok
begin_checkout / InitiateCheckoutCheckout page loadsGA4, Meta Pixel + CAPI, TikTok
add_payment_infoPayment method selected before placing the orderGA4
purchase / PurchaseOrder-received page (first load only)GA4, Google Ads, Meta Pixel, TikTok
purchase (server)Order status changes to processing or completed, sent from WooCommerce to sGTMMeta CAPI, GA4, TikTok Events API
Process

How the setup works

  1. 01

    Audit

    I check which plugins and snippets send data, how your caching is set up and which payment gateways redirect off-site, then compare recent platform conversions with WooCommerce orders.

  2. 02

    Clean up

    Duplicate trackers are removed or switched off, and the dataLayer plugin is configured, so there is one clear source for each event.

  3. 03

    Build browser and server tracking

    I set up GTM tags for GA4, Google Ads, Meta and TikTok, then add the server container and order-based purchase feed with shared event IDs.

  4. 04

    Test every gateway

    I place test orders through each payment method, including ones that redirect, with caching active, and confirm each order is counted once.

  5. 05

    Monitor and hand over

    I watch the numbers against WooCommerce for two weeks, then hand over a written event map and a short walkthrough.

Getting a reliable dataLayer out of WooCommerce

WooCommerce doesn't output a GA4-ready dataLayer by itself. A plugin like GTM4WP or Stape's WordPress plugin adds one, with product IDs, prices, quantities and order totals in a consistent format. GTM then reads that data instead of scraping it from the page, which is far less fragile when your theme changes.

The settings matter. I check that product IDs match your Merchant Center feed (SKU vs post ID), that tax and shipping are handled the way you want revenue reported, and that the purchase event is protected from firing twice on the same order.

Redirect gateways and why server-side is not optional

With an on-site card form, the customer usually lands on the order-received page and the purchase tag fires. With a redirect gateway, they pay on another site and may close the tab before coming back. Your WooCommerce order is marked paid, but GA4 and Meta never hear about it.

The fix is to send the purchase from the server when WooCommerce updates the order, not only from the browser. The Stape plugin can send order webhooks to a server GTM container, which then forwards the purchase to Meta CAPI and other platforms with the same event ID the browser would use, so a customer who does return isn't counted twice.

Official plugins vs GTM

Meta's and Google's official WooCommerce plugins are quick to install and handle catalogue sync well. For conversion tracking they give you less control and are a common source of duplicate events when GTM is also set up. I usually keep them for catalogue and feed features and turn off their purchase tracking, or keep them and skip the matching GTM tags. The rule is one sender per event per platform.

Case studies

Related projects

Tea of Sylhet: Meta Pixel & CAPI project by Chamok Mahonto
Meta Pixel & CAPI

Tea of Sylhet

A WooCommerce tea brand now sends server-side Meta purchase events with revenue, tracks custom micro events in GA4 and retargets shoppers by behavior.

  • Meta Pixel
  • Conversion API
  • GA4 Enhanced eCommerce
Read case study
Tea of Sylhet: Google Ads Tracking project by Chamok Mahonto
Google Ads Tracking

Tea of Sylhet

A hybrid client + server tracking rebuild for a premium tea brand, using a Stape server container and custom domain so Google Ads receives verified revenue.

  • GA4
  • GTM Web + Server
  • Stape
Read case study
FAQ

WooCommerce tracking FAQ

Which plugin should I use for WooCommerce GA4 tracking?

I usually use GTM4WP or Stape's WordPress plugin to generate the ecommerce dataLayer, with all tags managed in Google Tag Manager. That keeps tracking logic in one place and makes server-side tracking easy to add. The right choice depends on whether you also want Stape's server-side features.

Why are my WooCommerce purchases missing in GA4 or Meta?

The usual causes are redirect payment gateways where the customer doesn't return, caching or JavaScript-delay settings stopping tags, consent blocking, and ad blockers. A server-side purchase sent from WooCommerce order data covers most of the gateway and blocker losses.

Will a caching plugin break my tracking?

It can. Cart and checkout pages should not be cached, and GTM should be excluded from features that delay or combine JavaScript. I test with your actual caching setup switched on rather than turning it off during testing.

Can I use the official Facebook for WooCommerce plugin with CAPI?

Yes, Meta's plugin can send server events. If you also run GTM with Meta tags, turn one of them off for each event, or you'll get duplicates. For more control or other platforms, server GTM is the better long-term option.

Does this work with the new block-based WooCommerce checkout?

Yes, but some older plugins and custom code were written for the shortcode checkout and miss events on the block version. I check which checkout you're running and test each step before launch.

Guides

Read next

Want your WooCommerce tracking fixed?

Get a free audit of your tracking and ad account. Usually replies within 1–2 hours.