Why WooCommerce needs its own playbook
WooCommerce sites typically have THREE analytics layers: WordPress base (GA4 via plugin), WooCommerce hooks (purchase events via gtag), and possibly server-side bridge to Google Ads / Meta CAPI. Migration touches all three. Plausible can replicate purchase tracking but not cart-funnel analysis.
Pre-flight
- Inventory current install: WordPress base plugin (Site Kit / MonsterInsights / direct theme) AND WooCommerce-specific extension (MonsterInsights eCommerce, Enhanced Ecommerce for WC, etc.).
- Decide e-commerce parity scope. Plausible handles: purchase total + transaction ID. Does not handle: cart contents, item-level analysis, abandoned-cart funnels.
- Plan ad-platform impact. If Google Ads / Meta CAPI runs through GA4, you need to migrate the conversion-API stream separately (server-side, not via Plausible).
- Backup database. WooCommerce stores orders + customers — pre-migration
wp db exportmandatory.
Step-by-step
1. Install Plausible WordPress plugin (Day 1)
<br />
wp plugin install plausible-analytics –activate<br />
Configure: Settings → Plausible → enter domain. Enable “Track 404”, “Outbound links”, “File downloads”.
2. Hook WooCommerce purchase event (Day 1-2)
Add to your theme’s `functions.php` or a custom mu-plugin:
<br />
add_action(‘woocommerce_thankyou’, function ($order_id) {<br />
$order = wc_get_order($order_id);<br />
if (!$order) return;</p>
<p> $data = [<br />
‘name’ => ‘Purchase’,<br />
‘url’ => home_url($_SERVER[‘REQUEST_URI’]),<br />
‘domain’ => parse_url(home_url(), PHP_URL_HOST),<br />
‘props’ => [<br />
‘transaction_id’ => $order->get_order_number(),<br />
‘value’ => (float) $order->get_total(),<br />
‘currency’ => $order->get_currency(),<br />
‘item_count’ => $order->get_item_count(),<br />
],<br />
];</p>
<p> // Server-side firing avoids ad-blocker loss<br />
wp_remote_post(‘https://plausible.io/api/event’, [<br />
‘headers’ => [<br />
‘Content-Type’ => ‘application/json’,<br />
‘User-Agent’ => ‘WordPress/’ . get_bloginfo(‘version’),<br />
‘X-Forwarded-For’ => $_SERVER[‘REMOTE_ADDR’] ?? ”,<br />
],<br />
‘body’ => wp_json_encode($data),<br />
‘blocking’ => false, // fire-and-forget<br />
]);<br />
}, 10, 1);<br />
Server-side firing is more reliable than gtag-equivalent client-side because it avoids ad-blocker interference on the thank-you page.
3. Track add-to-cart + checkout-start (Day 2)
Optional but useful for funnel analysis:
<br />
// Add to your theme’s footer.php or via wp_enqueue<br />
jQuery(document.body).on(‘added_to_cart’, function() {<br />
plausible(‘Add to cart’);<br />
});</p>
<p>document.addEventListener(‘DOMContentLoaded’, function() {<br />
if (window.location.pathname.includes(‘/checkout/’)) {<br />
plausible(‘Begin checkout’);<br />
}<br />
});<br />
4. Dual-tag (Days 2-14)
Two-week minimum dual-tag is non-negotiable for e-commerce — purchase numbers must reconcile before you risk losing conversion tracking.
5. Cleanup (Day 14)
Order matters:
- Disconnect MonsterInsights eCommerce addon FIRST (if installed): Plugins → MonsterInsights eCommerce → Deactivate
- Then disconnect base GA4 plugin (Site Kit / MonsterInsights main)
- Finally search theme + mu-plugins for stray gtag
- Purge cache (WP Rocket / W3 Total Cache)
- Verify no gtag in Network tab on storefront + thank-you page
WooCommerce-specific gotchas
- Refund handling — Plausible’s “Refund” goal doesn’t auto-subtract from prior Purchase. Track separately, reconcile in DuckDB.
- Subscription products — WC Subscriptions fires `woocommerce_subscription_payment_complete` separately. Hook that for recurring revenue tracking.
- Tax / shipping inclusion — Decide whether `value` is `get_total()` (incl tax) or `get_subtotal()` (excl). Match GA4’s prior config or stakeholders will see “different numbers”.
- Currency on multi-currency stores — `get_currency()` returns shop’s display currency, not customer’s. For accurate revenue analysis, store both.
- Caching plugins on thank-you page — If thank-you page is cached, server-side fire still works (PHP runs); client-side won’t fire reliably.
Frequently asked
Can Plausible replace MonsterInsights eCommerce reports?
Partially. You get total revenue, transaction count, average order value. You don’t get top-selling-products, cart-abandonment funnel, or cohort revenue analysis without raw data export.
What about Google Ads / Meta CAPI conversions?
Migrate those server-side, decoupled from analytics. Use the WooCommerce thank-you hook to fire CAPI directly to Google Ads / Meta endpoints. Plausible isn’t a conversion-API platform.
Performance impact on storefront?
Plausible script (1.4kB) vs GA4+MonsterInsights (~140kB combined for some setups) — typically 200-500ms LCP improvement on category and product pages.
Migration timeline for 1000 orders/month store?
1 day install + 1 day code + 14 days dual-tag + 1 day cleanup = ~2.5 weeks elapsed, ~12 hours work.
Subscription products — anything special?
Hook `woocommerce_subscription_payment_complete` for recurring billings. Also `woocommerce_subscription_renewal_payment_complete`. Treat each as separate Purchase event.