Open-source WordPress plugin · PostHog for WooCommerce

Every WooCommerce order in PostHog.

Exactly once, on the visitor who placed it. 99Trace sends purchases, refunds and cancellations from your shop's server, so payment redirects, in-app browsers and ad blockers no longer lose orders.

Free · GPL-2.0-or-later · WordPress 6.5+ · WooCommerce 8.7+ · PHP 8.0+ · WordPress.org listing in review

A buyer moves from an in-app browser to a bank app to a new browser. At the end, Order Completed is sent once, on the same visitor.

The problem

The thank-you page is where tracking breaks.

Most PostHog setups for WooCommerce record a purchase on the thank-you page, in the buyer's browser. Four ordinary things make that page unreliable.

Payment redirects

Buyers pay in a banking app or on a payment page and come back in another browser, where PostHog does not know them, or is still waiting for cookie consent.

In-app browsers

A shopper browses inside Instagram or Facebook, pays, and lands in Safari or Chrome: one buyer, two visitors.

Ad blockers

When PostHog is blocked in the browser, the purchase is never recorded.

Reloads

A reloaded or reopened thank-you page records the same order again.

Because the loss depends on payment method and device, it can bias an A/B test, not only shrink it.

What 99Trace does

Your shop's server sends what matters.

Every paid order, exactly once

Order Completed is sent when WooCommerce marks the order paid, timestamped at the payment, with an event ID derived from the order. Retries and reloads never count it twice.

On the right visitor

The buyer's PostHog identity is saved with the order at checkout, before any redirect. The purchase is sent under it, whichever browser the buyer finishes in.

Refunds, cancellations, failed payments

Also from the server, so revenue in PostHog follows WooCommerce.

Cart and checkout events

Product Added, Checkout Started and coupon events at the moment WooCommerce changes the cart, also when PostHog is blocked in the browser.

One visitor ID

posthog-js and your shop share one first-party visitor ID, so browser and server events land on the same person without merging.

Safe for experiments

Feature flags and experiments keep working, and the flags a buyer had at checkout are copied onto the purchase for auditing.

PostHog in the browser, optional

Switch on the browser module and 99Trace runs posthog-js for you: page views, autocapture, heatmaps, web vitals, session replay, surveys and error tracking, each following your PostHog project's settings or overridden from WordPress. On order and account pages, replay, heatmaps and element text are always off.

Coverage you can check

WooCommerce → Status → 99Trace shows how many paid orders were sent, and how many are linked to a visitor, by payment method. Each order shows the identity saved at checkout and the delivery of every event.

How it works

The identity is saved before the buyer leaves.

  1. 01

    Browse

    posthog-js and 99Trace share one first-party visitor ID. Cart and checkout events go out from the server under that ID, also when an ad blocker stops PostHog in the browser.

  2. 02

    Check out

    Before the buyer leaves for the payment page, 99Trace saves their PostHog identity, session and feature flags with the order.

  3. 03

    Pay anywhere

    A banking app, a payment page, another browser: where the buyer finishes no longer decides whether the order is counted.

  4. 04

    Paid

    When WooCommerce marks the order paid, your server sends Order Completed once, at the payment time, under the saved identity. A later refund lands on the same person.

Events

Named the way PostHog's ecommerce events are.

Each event can be switched off or renamed, and is still sent exactly once. Amounts are numbers: revenue is the amount charged, net_revenue the merchandise after discounts.

EventSent fromWhen
Order CompletedServerThe order is paid (once, at the payment time)
Order RefundedServerA full or partial refund of a sent purchase
Order CancelledServerA sent purchase is cancelled
Payment FailedServerPayment fails or is cancelled before the order was paid
Checkout StartedServerThe checkout opens with items in the cart
Product Added, Product RemovedServerWooCommerce changes the cart
Coupon Applied, Coupon RemovedServerA coupon is added or removed
Product Viewed, View Category, Cart ViewedBrowserA product, category or cart page is viewed
Order Confirmation ViewedBrowserThe thank-you page is seen (once per order and browser)
$pageview, $pageleave, $autocapture, $dead_clickposthog-jsPostHog's own events

Every property and its source: docs/properties.md.

Privacy and control

Sends what you configure, and nothing else.

  • Data goes only to the PostHog project you configure, and only once you set the mode to On.
  • Never sends postal addresses or order keys, never uses an e-mail address as an ID, and removes order keys and e-mail addresses from every URL.
  • Consent: track every visitor, or follow Cookiebot or the WP Consent API, with three choices for what happens before the visitor answers. An order without consent can still be counted, without anything that identifies the buyer.
  • Switches for IP addresses and customer details. Shop staff, page editors and previews are excluded.
  • WordPress's privacy tools export and erase what 99Trace keeps on orders, and a suggested privacy policy text follows your settings.
  • Test mode writes every event to the WooCommerce log without sending it, and a copy of your shop at another address stops sending, so staging orders never reach your live project.

No plugin makes a shop GDPR compliant on its own: what you need depends on your country, your shop and what you record. 99Trace gives you the controls, and PostHog's EU or US Cloud or a self-hosted PostHog.

Screenshots

Every setting explains itself.

Connect: your PostHog project, the mode, and PostHog in the browser.
Connect: your PostHog project, the mode, and PostHog in the browser.
Consent: track every visitor or follow Cookiebot or the WP Consent API, and what happens before the visitor answers.
Consent: track every visitor or follow Cookiebot or the WP Consent API, and what happens before the visitor answers.
Events: every event 99Trace sends, with a switch and an optional name in PostHog.
Events: every event 99Trace sends, with a switch and an optional name in PostHog.
Visitors & orders: shop staff, person profiles, signed-in customers and one visitor ID for browser and server.
Visitors & orders: shop staff, person profiles, signed-in customers and one visitor ID for browser and server.
Each order shows the PostHog identity saved at checkout and the delivery of every event.
Each order shows the PostHog identity saved at checkout and the delivery of every event.
The coverage report: paid orders sent and linked to a visitor, by payment method.
The coverage report: paid orders sent and linked to a visitor, by payment method.

Install

Running in four steps.

Requirements: WordPress 6.5+, WooCommerce 8.7+, PHP 8.0+, and a PostHog project on PostHog Cloud (EU or US) or self-hosted.

  1. Download the zip from the latest release and upload it under Plugins → Add New → Upload. Once the WordPress.org listing is approved, you can install and update it from there.
  2. Open WooCommerce → 99Trace and enter your PostHog project API key and host.
  3. Set the mode to Test, place a test order and read the events in WooCommerce → Status → Logs (source 99trace).
  4. Choose your consent setting, switch on Run PostHog in the browser once any other PostHog plugin or snippet is removed, and set the mode to On.

Switching from 99Hog for WooCommerce? 99Trace is its new name. Activate 99Trace, deactivate 99Hog, then clear your page cache: settings, queued events and visitor IDs carry over, and 99Trace waits with a notice while 99Hog is still active.

Questions

Before you install

Do I need a PostHog account?

Yes: a project on PostHog Cloud (EU or US) or a self-hosted PostHog. PostHog's free tier covers many shops.

PostHog already runs on my site. Will anything be counted twice?

No. While another PostHog plugin is active, 99Trace never loads posthog-js, because two copies on one page split every visitor in two. It sends only its server events, under the visitor the other plugin's cookie names. Purchases paid before 99Trace started sending to your project are never sent again.

Does it work with the block checkout, HPOS and custom checkouts?

Yes. Block and classic checkouts, WooCommerce's custom order tables (HPOS) and checkout plugins such as FunnelKit are supported. A checkout that does not run the browser module still gets the visitor from the cookie.

Will it slow down my shop?

Cart and checkout events are sent after the page has gone to the shopper. Order events are sent in the background by WooCommerce's Action Scheduler. posthog-js loads asynchronously, as PostHog's own snippet does.

What happens when PostHog cannot be reached?

Order events are retried for about two days, and an hourly check queues any paid order that was missed. Each retry sends the same event with the same ID, so nothing is counted twice.

Can I try it without sending data?

Yes. In Test mode, 99Trace works out every event and writes it to WooCommerce → Status → Logs without sending anything, and PostHog runs in the browser without recording.

Open source

Free, and built to be checked.

99Trace is GPL-2.0-or-later. Every change runs PHP 8.0 to 8.4, more than 200 checks on a real WordPress and WooCommerce, and Plugin Check, the WordPress.org review tool. Issues and pull requests are welcome.

Made by 99Ways

99Ways is a research-led experimentation and CRO studio. We built 99Trace for experiments, where a purchase counted twice, or on the wrong visitor, changes the result.

99ways.io