Skip to main content
WooCommerce → AmplitudeIntegration guide

Connecting WooCommerce to Amplitude

WooCommerce keeps the order in your own database, which is both the advantage and the reason nobody has wired it properly. Amplitude is built around behavioural cohorts, which makes the identity resolution and the event taxonomy load-bearing in a way they never are for an ad pixel. The join between them succeeds or fails on one thing: whether the user ID and device ID pair reaches the WooCommerce order before the conversion happens, because Amplitude can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

WooCommerce in Amplitude: guest checkout and the device_id handoff

Guest checkout leaves many WooCommerce buyers without a user ID, so save the Amplitude browser SDK's device_id as order meta at checkout and send the purchase from woocommerce_payment_complete with it, plus user_id when logged in. Include price, quantity and productId per line item, and send refunds from woocommerce_order_refunded as negative revenue.

Most WooCommerce stores allow guest checkout, which means many buyers never get a WordPress user ID to use as Amplitude's user_id. If you send the purchase server-side from woocommerce_payment_complete with no identity, it lands on nobody; if you invent one per order, every repeat guest becomes a new user. The fix is to pass the Amplitude browser SDK's device_id into a hidden checkout field or cookie and save it as order meta, then send the purchase with that device_id, plus the user_id when the customer is logged in.

Send revenue the way Amplitude expects: price, quantity and productId per line item, with the variation ID or SKU used consistently. Refunds from woocommerce_order_refunded can be sent as a negative revenue event on the same identity, but check how your Amplitude charts treat negative revenue before relying on them.

Optimization plugins that delay JavaScript until user interaction will hold the Amplitude SDK back on fast-bouncing pages and change your session counts overnight. Exclude the SDK from that setting, then compare Amplitude purchases against WooCommerce orders in processing and completed status for the same week.

WooCommerce → Amplitude · what breaks

Why this join usually fails — WooCommerce → Amplitude

  1. 01

    The user ID and device ID pair 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.

  2. 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.

  3. 03

    Revenue events that carry no revenue

    Amplitude will happily accept a purchase event with no price field. The event count looks correct, the funnel looks correct, and the revenue reporting stays at zero — which people usually discover a quarter later when someone asks what a cohort is worth.

  4. 04

    Nothing reconciles afterwards

    Amplitude shows the event in the user's activity stream with its properties expanded. Read the properties, because an event that arrives without its revenue fields still looks like a success.

WooCommerce → Amplitude · the fix

What working looks like — WooCommerce → Amplitude

  • The user ID and device ID pair on every order

  • Conversions arriving in Amplitude

    The event lands on the user, joins their behavioural history, and becomes available for cohorts, funnels and retention.

  • Reconciled against the source

WooCommerce → Amplitude · architecture

How WooCommerce and Amplitude actually connect

  1. 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. 2

    Amplitude needs a click to match

    Amplitude needs a device or user identifier, an event type and its properties. Revenue events need the price and quantity fields specifically, or the revenue reporting stays empty while events flow normally.

  3. 3

    The identifier is the bridge

    The user ID and device ID pair, captured at the visit and carried into the WooCommerce order.

  4. 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. 5

    Deduplication at the destination

    Amplitude deduplicates on insert_id. Omit it and a retried batch is counted twice, which shows up as a phantom spike that someone will eventually build a hypothesis on.

WooCommerce → Amplitude · normal or broken

Working vs. broken, side by side — WooCommerce → Amplitude

Normal, not a fault

  • The user ID and device ID pair present on the order

  • Sent from the woocommerce_payment_complete hook

  • Deduplicated correctly

    Amplitude deduplicates on insert_id. Omit it and a retried batch is counted twice, which shows up as a phantom spike that someone will eventually build a hypothesis on.

  • Reconciles with the source

Actually broken

  • The user ID and device ID pair 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

    Amplitude will happily accept a purchase event with no price field. The event count looks correct, the funnel looks correct, and the revenue reporting stays at zero — which people usually discover a quarter later when someone asks what a cohort is worth.

  • Nobody has reconciled it

WooCommerce → Amplitude · diagnose

Diagnostic order — WooCommerce → Amplitude

  1. 01

    Count orders carrying the user ID and device ID pair

  2. 02

    Follow one real conversion end to end

  3. 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.

  4. 04

    Check a purchase event for the price and quantity fields specifically

    Not whether the event arrived — whether the revenue fields are populated, in the exact names Amplitude expects.

  5. 05

    Read the match rate, not the success message

    Amplitude shows the event in the user's activity stream with its properties expanded. Read the properties, because an event that arrives without its revenue fields still looks like a success.

WooCommerce → Amplitude · prove

How it gets proven — WooCommerce → Amplitude

Source of truth

WooCommerce → Orders (or the wp_wc_order_stats table), for the same window and status set.

  • The user ID and device ID pair confirmed present on a live order.
  • Revenue reconciled per transaction against your billing system, with identity merge behaviour verified across signup.
  • Order meta confirmed present on orders placed while full page caching was active.

WooCommerce → Amplitude · free audit

What we check in the free audit

  • Count orders carrying the user ID and device ID pair
  • Follow one real conversion end to end
  • Check order meta on ten recent orders
  • Check a purchase event for the price and quantity fields specifically
  • 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.

Get my free conversion tracking audit

Free30 minutesNo obligation

WooCommerce → Amplitude · when not to buy

When you don't need this — WooCommerce → Amplitude

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the user ID and device ID pair.
  • If you run a small store with no caching layer and a single free plugin already reporting accurately, leave it alone.
  • If nobody is building cohorts or retention analysis, this is a large amount of instrumentation for reporting a dashboard already gives you.

WooCommerce → Amplitude · what we deliver

What gets built — WooCommerce → Amplitude

  • 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 Amplitude

    The Amplitude HTTP V2 API, posted server-side with the identity, event type and properties.

  • 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.

Get my free conversion tracking audit

From $400 · See packages

FAQ

WooCommerce → Amplitude questions, answered

Save the browser SDK's device_id as order meta at checkout and send the server-side purchase with it. Add user_id only when the buyer is logged in.

Free · 30 min

Get WooCommerce and Amplitude joined properly

Free30 minutesNo obligation