Connecting WooCommerce to Matomo
WooCommerce keeps the order in your own database, which is both the advantage and the reason nobody has wired it properly. Matomo can be self-hosted with no third party in the chain, which makes it the one analytics destination where the data genuinely never leaves infrastructure you control. The join between them succeeds or fails on one thing: whether the first-party visitor ID reaches the WooCommerce order before the conversion happens, because Matomo can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
WooCommerce to Matomo: ecommerce orders from the payment hook
Start with the Matomo WordPress plugin's WooCommerce tracking. For server-side, save the visitor ID as order meta and call the HTTP Tracking API from woocommerce_payment_complete with the order number as order ID, revenue, tax, shipping, discount and line items. Matomo orders cannot be reversed, so source net revenue from WooCommerce.
The Matomo plugin for WordPress includes WooCommerce ecommerce tracking, and for many stores it is the right starting point; check what your version sends and whether it records orders from the browser or the server. Matomo running on your own WordPress domain is less affected by blockers than hosted tags, but the same caching and consent plugins can still delay the tracker on the order-received page.
For a server-side route, save the Matomo visitor ID as order meta during checkout, then call the HTTP Tracking API from woocommerce_payment_complete with that visitor ID, the WooCommerce order number as the ecommerce order ID, revenue, tax, shipping, discount and line items with SKU and category. Use the same order ID if the browser tracker also fires, and Matomo will not record the order twice.
A recorded Matomo ecommerce order cannot be reversed, so decide up front whether net revenue comes from Matomo or from WooCommerce, and if it is WooCommerce, say so in every report. Choose the status that counts too: an order recorded at checkout for a bank transfer that never arrives stays in Matomo forever, which firing on the payment hook avoids. On a self-hosted instance, check the archiving job is running before blaming WooCommerce for missing orders in reports.
WooCommerce → Matomo · what breaks
Why this join usually fails — WooCommerce → Matomo
- 01
The first-party visitor ID never reaches WooCommerce
WooCommerce sites are usually the most heavily plugged-in of any platform. Caching plugins serve a static page to the visitor, optimization plugins defer or strip scripts, and consent plugins block them entirely. Any of the three will stop an identifier being captured, and they fail silently.
- 02
Caching and optimization plugins eat the tracking
The page the customer sees is not the page your code assumed. This is the most common cause of WooCommerce tracking that worked at launch and silently stopped after a plugin update.
- 03
Owning the pipeline means owning the outage
The advantage is that nothing blocks it. The cost is that when the tracking database fills or falls behind on a weekend, the data is gone and no vendor is paging anyone. Hosted tools fail more visibly.
- 04
Nothing reconciles afterwards
Matomo exposes raw visit logs, so you can inspect the actual hit rather than an aggregate. Check the log, and check ingestion lag alongside it.
WooCommerce → Matomo · the fix
What working looks like — WooCommerce → Matomo
The first-party visitor ID on every order
Conversions arriving in Matomo
The event lands in your own database and is queryable directly, including the raw log, which most analytics products do not expose.
Reconciled against the source
WooCommerce → Matomo · architecture
How WooCommerce and Matomo actually connect
- 1
WooCommerce holds the truth
You own the database, so the truth is exactly as good as the query you write against it. Pin the status set first — whether processing, completed, or both count as a conversion changes the number by a lot and is the source of most arguments.
- 2
Matomo needs a click to match
The site ID, the visitor identifier and the event or ecommerce order. Self-hosted instances additionally need the tracker endpoint reachable and the database keeping up, which hosted tools do not fail at.
- 3
The identifier is the bridge
The first-party visitor ID, captured at the visit and carried into the WooCommerce order.
- 4
The event source decides reliability
Fire server-side from the PHP hook rather than from the thank-you page template. Page caching means the thank-you page cannot be relied on to execute anything, and on many stores it is served from cache to a paying customer.
- 5
Deduplication at the destination
Matomo deduplicates ecommerce orders on order ID. Without one, a refreshed confirmation page records a second order.
WooCommerce → Matomo · normal or broken
Working vs. broken, side by side — WooCommerce → Matomo
Normal, not a fault
The first-party visitor ID present on the order
Sent from the woocommerce_payment_complete hook
Deduplicated correctly
Matomo deduplicates ecommerce orders on order ID. Without one, a refreshed confirmation page records a second order.
Reconciles with the source
Actually broken
The first-party visitor ID missing on most records
WooCommerce sites are usually the most heavily plugged-in of any platform. Caching plugins serve a static page to the visitor, optimization plugins defer or strip scripts, and consent plugins block them entirely. Any of the three will stop an identifier being captured, and they fail silently.
Sent from the browser
The page the customer sees is not the page your code assumed. This is the most common cause of WooCommerce tracking that worked at launch and silently stopped after a plugin update.
Counted twice, or not at all
The advantage is that nothing blocks it. The cost is that when the tracking database fills or falls behind on a weekend, the data is gone and no vendor is paging anyone. Hosted tools fail more visibly.
Nobody has reconciled it
WooCommerce → Matomo · diagnose
Diagnostic order — WooCommerce → Matomo
- 01
Count orders carrying the first-party visitor ID
- 02
Follow one real conversion end to end
- 03
Check order meta on ten recent orders
Directly in the database or with a meta viewer. Then disable page caching for the checkout path and see whether coverage changes — if it does, caching is your cause.
- 04
Check tracker reachability and database lag before debugging any tag
On self-hosted analytics the answer is infrastructure more often than instrumentation.
- 05
Read the match rate, not the success message
Matomo exposes raw visit logs, so you can inspect the actual hit rather than an aggregate. Check the log, and check ingestion lag alongside it.
WooCommerce → Matomo · prove
How it gets proven — WooCommerce → Matomo
Source of truth
WooCommerce → Orders (or the wp_wc_order_stats table), for the same window and status set.
- The first-party visitor ID confirmed present on a live order.
- Orders reconciled against the Matomo ecommerce log with order-ID deduplication verified.
- Order meta confirmed present on orders placed while full page caching was active.
WooCommerce → Matomo · free audit
What we check in the free audit
- Count orders carrying the first-party visitor ID
- Follow one real conversion end to end
- Check order meta on ten recent orders
- Check tracker reachability and database lag before debugging any tag
- Read the match rate, not the success message
Checked against
WooCommerce → Orders (or the wp_wc_order_stats table), for the same window and status set.
Free30 minutesNo obligation
WooCommerce → Matomo · when not to buy
When you don't need this — WooCommerce → Matomo
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the first-party visitor ID.
- If you run a small store with no caching layer and a single free plugin already reporting accurately, leave it alone.
- If you have no privacy or ownership requirement and no team to run it, a hosted product removes the only real cost of this one.
WooCommerce → Matomo · what we deliver
What gets built — WooCommerce → Matomo
Identifier capture into WooCommerce
Capture the click identifier and persist it as order meta on the order object with a small snippet in the theme's functions or a purpose-built plugin. Order meta lives in your own database, so it survives caching, plugin conflicts and the customer's browser.
Event source: the woocommerce_payment_complete hook
Fire server-side from the PHP hook rather than from the thank-you page template. Page caching means the thank-you page cannot be relied on to execute anything, and on many stores it is served from cache to a paying customer.
Dispatch to Matomo
The Matomo HTTP Tracking API, posted server-side from your order system.
Reversals where they exist
The refund hooks carry the order ID, so reversals are straightforward once the identifier is on the order.
Written guarantee
95%+ tracking accuracy
Measured against WooCommerce → Orders (or the wp_wc_order_stats table), for the same window and status set.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
WooCommerce → Matomo questions, answered
Yes; the Matomo plugin for WordPress includes WooCommerce ecommerce tracking. For orders lost to caching or blockers, send them server-side through the HTTP Tracking API with the stored visitor ID.
Matomo does not reverse a recorded ecommerce order, so report net revenue from WooCommerce or adjust in your own reporting. Recording orders only when paid keeps unpaid on-hold orders out.
Almost always because the first-party visitor ID never reached the WooCommerce order. WooCommerce sites are usually the most heavily plugged-in of any platform. Caching plugins serve a static page to the visitor, optimization plugins defer or strip scripts, and consent plugins block them entirely. Any of the three will stop an identifier being captured, and they fail silently. Measure coverage before debugging the dispatch.
Matomo sets its own first-party cookie and, when self-hosted on your domain, is not a third-party request at all. That means ad blockers and browser tracking-prevention affect it far less than a hosted analytics tag — one of the few genuine measurement advantages available under current privacy conditions.
The woocommerce_payment_complete hook. Fire server-side from the PHP hook rather than from the thank-you page template. Page caching means the thank-you page cannot be relied on to execute anything, and on many stores it is served from cache to a paying customer.
Matomo exposes raw visit logs, so you can inspect the actual hit rather than an aggregate. Check the log, and check ingestion lag alongside it.
More on WooCommerce → Matomo
- WooCommerce Subscriptions → MatomoConnecting WooCommerce Subscriptions to Matomo
- WooCommerce → HubSpotConnecting WooCommerce to HubSpot
- WooCommerce → TikTokConnecting WooCommerce to TikTok Events API
RELATED GUIDES
Where WooCommerce → Matomo fits in the rest of your tracking
- nopCommerce → MatomoConnecting nopCommerce to Matomo
- Shopify → MatomoConnecting Shopify to Matomo
- Squarespace → MatomoConnecting Squarespace Commerce to Matomo
- WooCommerce → Adobe AnalyticsConnecting WooCommerce to Adobe Analytics
- WooCommerce → AmplitudeConnecting WooCommerce to Amplitude
- Furniture ecommerceConversion tracking for furniture ecommerce, measured after delivery
- Swell → MatomoConnecting Swell to Matomo
- BigCommerce → MatomoConnecting BigCommerce to Matomo
Free · 30 min
Get WooCommerce and Matomo joined properly
Free30 minutesNo obligation
