Skip to content

Tracking/WooCommerce tracking

WooCommerce tracking without the plugin pile-up

A typical WooCommerce store has three or four tracking plugins, each adding its own pixel and none agreeing on revenue. We replace them with one dataLayer, GTM in the browser and server-side purchase events from WooCommerce itself, so orders are counted once and pages load faster.

Data flowin / via / out
  1. Captured from

    • WooCommerce pages
    • Order paid hook
  2. Processed in

    • Ecommerce dataLayer
    • Server GTM
  3. Sent to

    • GA4
    • Google Ads
    • Meta CAPI
Typical timeline
2 to 3 weeks
Works with
WooCommerce, WordPress, Google Tag Manager
Pricing
Quoted after a short call
You keep
Full access and documentation

01/WooCommerce Tracking, in short

WooCommerce tracking setup replaces stacked tracking plugins with one ecommerce dataLayer, GTM in the browser and server-side purchase events sent from WooCommerce itself. That catches orders paid through PayPal, Klarna and other redirect gateways, removes duplicate pixels, and keeps GA4, Google Ads and Meta in line with your real orders.

02/Where it breaks

What we usually find first

  1. 01Several plugins all send the same purchase
  2. 02Caching or a page builder breaks the dataLayer on some pages
  3. 03PayPal and other gateways redirect buyers who never see the thank-you page
  4. 04GA4 revenue includes tax and shipping on some orders and not others
  5. 05Meta and Google Ads report far fewer purchases than WooCommerce

When it's done

One tracking setup instead of several plugins, purchases counted once from the order itself, and a lighter store.

03/What you get

What the WooCommerce setup includes

01
Plugin and script clean-up
What each tracking plugin does, which to keep and which to remove.
02
Ecommerce dataLayer
GA4 ecommerce events from product list to purchase, with item IDs that match your product feeds.
03
Server-side purchases
Orders sent to server GTM from WooCommerce, so payment redirects and ad blockers don't lose them.
04
Ad platform events
GA4, Google Ads with Enhanced Conversions, Meta CAPI and TikTok, deduplicated across browser and server.
05
Caching-safe setup
Tested with your caching plugin and CDN, so events keep working on cached pages.
06
Refunds and order status
Refunds and cancellations sent to GA4, so revenue stays close to what you actually kept.

04/Under the hood

Server-side purchase from the order itself

Fires when payment completes, even if the buyer never returns to the thank-you page.

Server-side purchase from the order itself

PHP
add_action('woocommerce_payment_complete', function ($order_id) {    $order = wc_get_order($order_id);    if ($order->get_meta('_ad_purchase_sent')) return;   // send once     wp_remote_post('https://data.yourstore.com/wc/purchase', [        'timeout' => 3,        'body'    => wp_json_encode([            'event_id'       => 'wc_' . $order_id,            'transaction_id' => (string) $order_id,            'value'          => (float) $order->get_subtotal(),            'currency'       => $order->get_currency(),            'email'          => $order->get_billing_email(),            'client_id'      => $order->get_meta('_ga_client_id'),        ]),    ]);    $order->update_meta_data('_ad_purchase_sent', 1);    $order->save();});

IDs are placeholders. In your project this lives in your own accounts, with a written note on what it does and how to change it.

05/Process

Three steps, in this order

  1. 01

    Audit plugins and orders

    We list every tracking plugin and compare platform purchases with WooCommerce orders.

  2. 02

    Build on staging

    dataLayer, GTM and server container are built on a staging copy and tested with real gateways.

  3. 03

    Switch over and compare

    Old plugins come off, the new setup goes live, and we compare numbers for two weeks.

06/Who it's for

A good fit if you are

  • WooCommerce stores with paid traffic from Google and Meta
  • Stores using off-site payment gateways
  • WordPress sites slowed down by tracking plugins

Tools we work in

WooCommerce / WordPress / Google Tag Manager / Server GTM / Stape / GA4 / Meta CAPI / Google Ads

Sounds like you? We look at your current setup on a call and tell you what we'd fix first, whether or not you hire us.

Book a call

07/Questions

WooCommerce Tracking: common questions

Which plugin do you use for the dataLayer?

It depends on the store. GTM4WP is a solid option for many sites. For others we push the dataLayer from a small custom plugin so we control every field. Either way you end up with one source, not several.

What about orders paid through PayPal or Klarna?

Those gateways send buyers away, and not all of them come back to the thank-you page. Server-side events from the WooCommerce order catch those purchases anyway.

Will this slow the site down?

It usually does the opposite, because duplicate pixels are removed and some of the work moves to the server.

Talk to a specialist about WooCommerce Tracking

Tell us what you're running and what doesn't add up. We'll tell you what we'd check first, usually on a 30 minute call.