Server-side tracking for WooCommerce: how to set it up
Server-side tracking in WooCommerce works best when the purchase starts from the paid order on your shop’s server, and the browsing events keep coming from the shopper’s browser through your own subdomain. The two copies of each purchase share one ID, consent is saved at checkout, and only one integration sends the server copy.
What the server sends, and what the browser sends
Split the events by where they happen:
| Event | Sent from | Why |
|---|---|---|
| Product view, add to cart, checkout | Browser | They happen in the browser, and the platforms need its context (page, click IDs, cookies) |
| Purchase | Server, and the browser as a fallback | The server copy arrives even without the thank-you page; the browser copy goes out only if the server copy doesn’t arrive in 15 minutes |
| Refund | Server | It happens in the admin panel, days later |
The browser copy of the purchase fires on the thank-you page. The server copy goes out when WooCommerce marks the order as paid, or moves it to processing or completed, whichever comes first. An order paid in a gateway, with no return to the shop, still counts, as long as there was consent at checkout.
What you need
- WordPress 6.4 or later, PHP 7.4 or later with the
sodiumextension, and WooCommerce 8.0 or later, for the TallyHost plugin. - A cookie banner that sends Google Consent Mode v2. Without one, nothing reaches the platforms. With IAB TCF on, even next to Consent Mode, TikTok gets nothing and Meta needs Google’s Additional Consent.
- A subdomain of your shop for the tracking script, for example
rk4vqz.yourshop.com, with a few DNS records (A, AAAA and a TXT check). - Access to your Meta, TikTok, GA4 or Google Ads accounts, to connect them in the panel.
Setting it up, step by step
- Install and activate the plugin. Orders placed before activation aren’t sent later.
- Pair it with your site in the panel. The panel gives you a one-time pairing key, valid for 24 hours. The plugin generates its own signing key and sends only the public half; the private key never leaves your shop. Every purchase and refund from the server is signed with it.
- Add the subdomain. The panel shows the DNS records. Once the subdomain is live, the plugin adds the script from it, first in
<head>. Server events can start before that, but they reach the platforms only once the script on your pages has recorded the shopper’s consent. - Check your data layer. The script reads the standard GA4 e-commerce data layer (
view_item,add_to_cart,begin_checkout,purchase). If none of the plugins it knows for that is installed (GTM4WP, Google Analytics for WooCommerce, Pixel Manager, Conversios, GTM Ecommerce for WooCommerce), the TallyHost plugin adds it. - Connect the platforms in the panel and send a test event to each.
Plugins that count orders twice
Several plugins send their own conversions to the same platforms:
- Facebook for WooCommerce and Meta Pixel for WordPress (Conversions API),
- PixelYourSite and PixelYourSite Pro,
- TikTok for WooCommerce (Events API),
- Pixel Manager for WooCommerce, Conversios,
- Google Analytics for WooCommerce (GA4).
The TallyHost plugin warns when it finds one of them. The problem isn’t the plugin; it’s two integrations sending the same purchase:
- Meta merges a Pixel copy with a Conversions API copy that has the same
event_id, but never two copies sent through the Conversions API. Two server integrations mean two purchases. Turn off purchase events in the other plugin. - GA4 merges two purchases only with the same
transaction_id. The TallyHost plugin sends the WooCommerce order number, so a gtag purchase in another plugin has to use the order number too. Refunds and leads aren’t merged at all: if TallyHost sends them, remove them from gtag.
How Meta matches the Pixel and the server copy covers the remaining cases.
Refunds
A refund in WooCommerce sends one refund event per refund, from your server. What happens next depends on the platform:
- Meta and TikTok have no refund event. Their reported revenue stays higher than your shop’s.
- GA4 gets a
refundfrom the server, matched to the purchase by the transaction ID. - Google Ads lowers the value of the original conversion with the same transaction ID; the number of conversions stays. TallyHost sends the adjustment only for purchases it sent to Google Ads itself in the last 92 days. Google applies no value changes in the first 14 days of a new conversion action fed from several sources.
Safari and the identity cookie
Safari shortens cookies written by JavaScript to 7 days, and cookies set by a server with a different IP address than your site to 7 days too. That includes our subdomain. The plugin’s optional same-IP mode renews the same cookies from your shop’s own server, which Safari keeps for their full lifetime. It’s off by default: turn it on once your cookie policy and banner list those cookies.
How to check it works
- Accept everything in the banner and place a test order. Each platform should get the purchase once.
- Reject everything and place another. Nothing should reach the ad platforms.
- Pay a third order through a gateway and close the tab before the thank-you page. The purchase should still arrive.
- Refund one of them and check the refund where the platform supports it.
The TallyHost debugger shows each event, its consent and every platform’s answer, so a missing or doubled purchase shows up there first. If orders are missing in GA4 only, our guide on why GA4 shows fewer orders than WooCommerce goes through the causes. The integrations page lists what each platform receives.
Send your shop's orders from the server
TallyHost reports paid orders with consent checked, to Meta, TikTok, GA4 and Google Ads. Free up to 100,000 events a month.
Start free