99Trace

99Trace documentation

Every setting with its default, every event and what it carries, how to check the data in PostHog, and how to fix problems.

On this page
  1. Settings
    1. Connect
    2. Consent
    3. Events
    4. Browser features
    5. Visitors & orders
    6. Advanced
  2. Events
    1. What each event carries
  3. The purchase event
  4. Check the data
  5. Troubleshooting
  6. Limits

What does each setting do?Link to this section

Every setting is under WooCommerce → 99Trace, in six tabs. Each entry gives the default, what the setting does, when to change it, and what goes wrong when it is set wrong. Developer hooks, constants and stored names are in docs/developers.md ↗ (opens in a new tab).

ConnectLink to this section

SettingDefaultDescription
ModeOff

Off: 99Trace does nothing. Test: 99Trace works out every event and writes it to the log without sending it; PostHog runs in the browser but records nothing. On: events are sent to PostHog.

When to change: Test while you set up; On once the test order looks right. On a staging copy, a W99_TRACE_MODE constant in wp-config.php overrides this setting.

If set wrong: Left on Test, nothing reaches PostHog, and the orders paid meanwhile are never sent.

Project API keyempty

The key of the PostHog project to send to, from PostHog → Settings → Project → Project API key. It starts with phc_. Browser and server events go to the same project.

When to change: When you send to another project. Use the key of your existing PostHog setup to keep its visitors.

If set wrong: Empty: nothing is sent. Another project's key: your shop's data goes to that project, and every visitor starts new there.

PostHog hosthttps://eu.i.posthog.com

Where the shop's server sends events, and posthog-js too unless you set a browser host.

When to change: https://us.i.posthog.com for a project on US Cloud, or your own PostHog's address.

If set wrong: A host in the wrong region rejects the events. Each failed send appears in the 99trace log as Send failed.

Run PostHog in the browserOff

Loads PostHog (posthog-js) in visitors' browsers for page views, clicks, browser events and experiments, with one visitor ID shared with the server's events. Off: only the shop's server sends events.

When to change: Switch it on once no other PostHog runs on the site (how to switch).

If set wrong: Beside another copy of PostHog, every visitor is split in two. 99Trace stays off in the browser while it detects another PostHog plugin, but it can't see snippets or tags. Off: no page views, funnels, replay or experiments.

Browser host (proxy)empty (the PostHog host)

Your own address that forwards to PostHog, such as https://ph.example.com. posthog-js loads from it and sends browser events through it, so fewer ad blockers stop them (+). Server events always use the PostHog host.

When to change: When you run a reverse proxy for PostHog.

If set wrong: An address that doesn't forward to PostHog stops posthog-js from loading: no browser events, while server events still arrive.

SettingDefaultDescription
Before the visitor answers the bannerWait

What PostHog does until the visitor answers: Wait, Record the visit, send it when the visitor accepts, or Load PostHog switched off. Only with Cookiebot or the WP Consent API. The three are compared above.

When to change: Record the visit keeps the visits of people who accept. Switched off shows experiment variants at once.

If set wrong: Wait loses every page before the answer, and experiments give no variant until then. The other two ask PostHog for experiment variants before consent.

Record the visit: keep it across pages until the answerOff

Off: only the page where the visitor answers is sent. On: the recording of earlier pages is kept in the browser's session storage, deleted when the tab closes, and sent too.

When to change: Visitors often browse several pages before they answer, and storing data in the browser before consent is allowed where you sell.

If set wrong: On where that storage isn't allowed: the browser holds data before consent.

EventsLink to this section

SettingDefaultDescription
Events tableevery event on, standard names

A switch and an optional name in PostHog for every event; the list of events is on the home page. PostHog's own events ($pageview, $pageleave, $autocapture, $dead_click) can be switched off but keep their names. Browser and PostHog events need Run PostHog in the browser.

When to change: Rename events to match an existing setup's names; switch off events you don't use. A name is plain text of up to 100 characters, doesn't start with $ and isn't another event's name; a rejected name falls back to the standard one.

If set wrong: A renamed event is still sent once, under its new name, so insights, funnels and destinations that use the old name stop matching. With Order Completed off, refunds and cancellations are not sent either.

Carts the checkout page fillsNot sent

Some checkout pages, such as FunnelKit funnels, put the product in the cart when they open. Not sent: Product Added only when the shopper adds a product. Sent as Product Added: each such page load also sends Product Added, marked source checkout_page.

When to change: Rarely: Checkout Started already records the visit with its products.

If set wrong: Sent: ad platforms fed from Product Added count every checkout load as an add to cart.

Product custom fieldsNot sent

Adds product custom fields, the data other plugins and themes save on a product, to server events. Visible custom fields: those in the product editor's Custom Fields box. All custom fields: hidden ones too, and WooCommerce's cost of goods. Values over 500 characters are cut, and custom fields never go into the page.

When to change: When you analyse by something only a custom field holds, such as a product line.

If set wrong: All can send internal data, such as purchase costs or supplier codes, to PostHog.

Browser featuresLink to this section

Only with Run PostHog in the browser on. Most features also have a switch in your PostHog project, under Settings → Project. PostHog's setting, the default, leaves the choice to that switch; Always on and Always off override it on this shop. A change in PostHog reaches pages opened after it.

FeatureWhat it recordsChoices
AutocaptureClicks, form submissions and changes ($autocapture)PostHog's setting · Always off
Dead clicksClicks after which nothing on the page changes for 2.5 seconds ($dead_click)PostHog's setting · Always on · Always off
Page speed (web vitals)How fast pages load and react in visitors' browsers ($web_vitals)PostHog's setting · Always on · Always off
HeatmapsWhere visitors click, move and scrollPostHog's setting · Always on · Always off
Session replayRecordings of visitsPostHog's setting · Always off
SurveysShows surveys made in PostHogPostHog's setting · Always off
JavaScript errorsErrors in the shop's pages, for PostHog's error tracking ($exception)PostHog's setting · Always on · Always off

Autocapture, replay and surveys have no Always on: the page can switch them off, and only PostHog's own switch turns them on. On order and account pages, replay, heatmaps and element text are always off, because those pages show the buyer's name and address.

Four more switches have no counterpart in PostHog:

SettingDefaultDescription
Rage clicksOnRecords several quick clicks on one spot, a sign of frustration. Off: fewer events, and no such signal.
Feature flags and experimentsOnLets PostHog's flags and experiments decide what a visitor sees. Off: no experiment can run on the shop, and Load PostHog switched off works as Wait.
One visitor across subdomainsOnRecognises one visitor on shop.example.com and www.example.com. Off: each subdomain has its own visitors.
Hide all textOffOn: clicks and recordings never contain the page's text, on every page. Use it when other pages show personal data too; clicks then lose the text that names them.

Visitors & ordersLink to this section

SettingDefaultDescription
Shop staffNot recorded

Signed-in administrators and shop managers. Not recorded: nothing from them reaches PostHog, including page views, recordings, experiments, carts and checkouts. A purchase they make is still counted, without their visits.

When to change: Recorded, if staff browsing should be in your data.

If set wrong: Recorded: staff test visits count as shopping, also in ad platforms fed from PostHog. Staff are recognised only while signed in.

Page editorsNot recorded

Signed-in users who can edit pages but not manage orders, such as editors and roles made for page builders. Not recorded works as for shop staff.

If set wrong: Recorded: their test visits to product and checkout pages count as shopping.

Preview loadsNot recorded

Pages open in a page builder or as a preview: Elementor's editor and preview, FunnelKit's previews, WordPress page previews and the Customizer. Not recorded: never sent, whoever opens them.

If set wrong: Recorded: every editing session sends page views and cart events.

Person profilesEvery visitor

Every visitor gives each visitor a person in PostHog, so you can open a buyer and see their whole journey. Only logged-in customers creates persons only for customers who sign in; other visitors' events still count but belong to no person, and PostHog bills such events at a lower rate. Browser and server events follow the same choice.

When to change: Only logged-in customers, to lower PostHog's bill when you don't need guests' journeys.

If set wrong: With Only logged-in customers, you can't open a guest buyer and see the pages before the order.

Recognise logged-in customers on every deviceOn

A customer who signs in is joined to one person on every device they use. The account is named by an anonymous number (wc:<shop>:<user ID>), never by e-mail address or name.

If set wrong: Off: one customer on two devices stays two people.

One visitor ID for the browser and the shopOn

The shop's server events (cart, coupon, checkout, order) and PostHog in the browser use one visitor ID, kept in a first-party cookie, ph_wc_vid. An add to cart before PostHog has loaded, or while an ad blocker stops it, lands on the same person. The cookie is written only where the visitor may be recorded, and only while 99Trace runs PostHog in the browser.

If set wrong: Off: cart and checkout events are sent only when PostHog's own cookie exists, so visitors whose browser blocks PostHog lose them.

Customer details on the personOn

Sets the buyer's e-mail, first and last name and phone on their PostHog person: as they are typed at checkout, when an order is paid, and when a customer signs in or creates an account. Only for visitors who may be recorded, never on an anonymous order, and never inside events or web addresses. PostHog's destinations, such as Meta and Google Ads, hash them before sending.

When to change: Off, if you send no conversions to ad platforms and need no customer details in PostHog.

If set wrong: Off while an ad destination matches buyers by e-mail or phone: it has nothing to match them with.

Join the thank-you page's browser to the buyerOn

A buyer who pays in a bank app often comes back in another browser. That browser continues as the buyer's visitor, or is merged into it when it already has a history of its own. It also links an order placed before consent when the buyer accepts on its thank-you page, while the order is still waiting to be sent.

If set wrong: Off: the thank-you page in the other browser starts a new visitor, and orders placed before consent stay anonymous.

Locate buyers by their own IP addressOn

Server events pass the buyer's IP address, so PostHog shows the buyer's country and city rather than the server's. Never on an order without consent.

When to change: Off, if you decide not to send buyers' IP addresses to PostHog.

If set wrong: Off: server events have no location, and PostHog stores the shop server's address on them unless your project discards IP data.

Wait before sending an order (minutes)10 · 0 to 120

Holds each paid order before sending it, so a one-click upsell accepted after payment becomes part of the purchase, and a buyer who accepts cookies on the thank-you page can still be linked. The purchase keeps the time of payment.

When to change: 0 for faster orders in PostHog, on a shop with no upsells after payment and no cookie banner.

If set wrong: Too short: an upsell accepted after the send is missing from the purchase. The order is sent by the next run of WordPress's scheduled tasks after the wait, so it arrives a little later than the wait alone.

AdvancedLink to this section

SettingDefaultDescription
URL parameters never sentkey, order_key, wfocu-key, _wpnonce, token, email, billing_email, phone

Comma-separated parameters removed from every web address PostHog receives, at any depth. Order keys (wc_order_…) and e-mail addresses are always removed.

When to change: Add the parameters that carry personal data or tokens in your shop's links.

If set wrong: A default you remove lets that parameter's value reach PostHog.

Further posthog-js options (JSON)empty

Any posthog-js option that has no setting above, as a JSON object, applied on top of the Browser features. For example {"session_recording": {"maskAllInputs": true}}. Options that 99Trace's identity, consent and privacy handling depend on, such as api_host, persistence and bootstrap, are ignored.

If set wrong: Text that is not a JSON object: none of it is applied, and a notice says so.

Read the visitor from keyempty

Only while another PostHog runs in the browser and 99Trace sends server events beside it: the project key whose PostHog cookie names the visitor. Empty: the key saved by the PostHog Integration plugin from WooCommerce.com, if the site has one, else the key under Connect. Ignored once 99Trace runs PostHog in the browser.

When to change: When 99Trace runs beside your old setup and that setup sends to another project.

If set wrong: A key whose cookie your visitors don't have: cart and checkout events are not sent, and orders arrive without a visitor.

Debug loggingOff

Writes what 99Trace does to WooCommerce → Status → Logs (source 99trace) and to the browser console. Sent events and failed sends are logged without it.

When to change: On while you look into a problem, off afterwards.

Which events does 99Trace send?Link to this section

Named the way PostHog's ecommerce events are. Each event can be switched off or renamed under Events, 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

What the other events carryLink to this section

  • Order Refunded: the order ID and number, the refunded amount (refund_amount, and revenue as a positive number), whether the refund is full, its reason and the refunded products, on the same person as the purchase.
  • Order Cancelled: the order ID and number, the revenue refunds had not already taken back, currency and payment method, timestamped at the cancellation.
  • Payment Failed: the order ID and number, failure_status (failed or cancelled), the attempt number, minutes since the order, the total, payment method and products.
  • Checkout Started: the cart total as revenue, the products, the cart's ID and the kind of checkout (block, classic or funnelkit).
  • Product Added and Product Removed: the product, variant, SKU, price, quantity and value, and source, where the change came from.
  • Coupon Applied and Coupon Removed: the coupon code and its discount.

Every property and its source: docs/properties.md ↗ (opens in a new tab).

What does the purchase event contain?Link to this section

Order Completed is sent once for each paid order. The list of events is on the home page; each event can be switched off or renamed under Events. An order counted without consent carries less: what an anonymous order carries.

Order Completed from the server · once per order · at the payment time
Money
revenuenet_revenuetotalsubtotalshippingtaxdiscountcouponcurrency

revenue is the amount charged; net_revenue the products after discounts.

Order
order_idorder_numberpayment_methodorder_placed_atreturning_customer
Products
products[]

Each with ID, SKU, name, price, quantity, attributes (such as the bundle or colour), categories, tags, brand and stock status.

Visit
checkout_flags

The experiment variants at checkout, with the UTM parameters, click IDs, browser and device.

Source
tracking_sourceidentity_sourceconsent

tracking_source is server; identity_source says where the identity came from.

Every property and its source: docs/properties.md ↗ (opens in a new tab)

Never sent Postal addresses and order keys. E-mail and name go only on the person, and only with Customer details on the person on.

How do I check the data in PostHog?Link to this section

After the first order, these checks keep the data honest. Each takes a few minutes in WooCommerce and PostHog.

CheckHow
Every paid order arrivesWooCommerce → Status → 99Trace counts the last 30 days' paid orders by delivery state. Compare a day's Order Completed count in PostHog with WooCommerce's paid orders.
Each order onceIn PostHog, group Order Completed by order_id: each order appears once. Reload a thank-you page: no second event arrives.
On the right personOpen the person behind an Order Completed: the page views before checkout are on the same person. The order's PostHog (99Trace) box shows the identity saved at checkout.
Fair to experimentsExperiment metrics see only purchases linked to a visitor. Before reading a test result, compare the linked share per variant.
TimesAn order's payment time in WooCommerce matches the event time in PostHog.
Staff left outVisit the shop signed in as an administrator: nothing arrives in PostHog.
No order keysSearch PostHog for wc_order_: no 99Trace event contains it.

What can go wrong, and how do I fix it?Link to this section

Each row starts from what you see. The 99trace log under WooCommerce → Status → Logs and the order's PostHog (99Trace) box show most causes.

What you seeCauseFix
Nothing arrives in PostHogThe mode isn't On, there is no project key, or the host is in the wrong region. A red notice saying 99Trace has stopped sending means the site's address changed.The Connect tab's first line names the host and key in use; a US Cloud project needs https://us.i.posthog.com. On the live shop at a new address, click Send from this address.
Paid orders arrive hours lateWordPress's scheduled tasks don't run, so the background queue stalls.Tools → Site Health lists late scheduled events, and WooCommerce → Status → Scheduled Actions (group w99-phwc) the waiting sends. Ask your host to run WP-Cron from a server cron job.
Some paid orders are missingOrders created in the WooCommerce admin, orders paid before 99Trace was switched on or in Test mode, and orders without consent when Orders without consent is Not sent.These are left out by design. The order's box and WooCommerce → Status → 99Trace show each order's state, with the reason for a skipped one.
A purchase has no person or page viewsThe buyer refused or never answered the banner, so the order was counted anonymously.Expected. The box shows Identity not linked and the consent state.
Visitors split in two, or page views doubledTwo copies of PostHog run: a snippet, a Google Tag Manager tag or another plugin beside 99Trace. Or the old setup used another project key.Remove the other copy and clear caches, then run the split checks.
Events from shop staffStaff tested while signed out, their role can neither manage orders nor edit pages, or Shop staff is set to Recorded.Test while signed in, or filter your team's visits out in PostHog.
Pages still run the old setup or old settingsThe page cache serves pages cached before the change: 99Trace's settings are part of each page.Clear the page cache and any CDN after changing Connect, Consent or Browser features, then check the source of a cached page.
Page views start only after a click or scrollA speed plugin delays JavaScript until the visitor interacts.99Trace excludes its script from WP Rocket's delay and marks it for other optimizers to skip. If yours ignores the mark, exclude 99trace.js by hand and clear the cache.
PostHog doesn't run in the browserAnother PostHog plugin is active, Automatic consent found no consent platform, or another copy of PostHog started first on the page.A notice names the first two. Deactivate the other plugin, or choose the consent option that matches your banner. With Debug logging, the browser console names the third.
A Product Added on every checkout visitCarts the checkout page fills is set to Sent.Set it to Not sent.
Insights or destinations stopped after an event was renamedThe event is sent under its new name.Change them to the new name.
Some visitors have orders but no page viewsAn ad blocker stops PostHog in their browsers.Orders are unaffected. A browser host (proxy) recovers part of the browser events.

What doesn't 99Trace do?Link to this section

Its limits, so you can plan around them. If one of them rules 99Trace out for your shop, every way to connect PostHog to WooCommerce ↗ (opens in a new tab) is compared on 99ways.io, with when to choose each.

ScopeLink to this section

  • WooCommerce only.
  • No past orders: the history in PostHog starts when you switch it on.
  • Orders typed in by staff in the WooCommerce admin are not sent.

VisitorsLink to this section

  • Refused cookies: the purchase is anonymous or not sent, and the browsing is not recorded.
  • Ad blocker and no proxy: the purchase arrives, the page views do not.
  • One guest buyer on two devices stays two people: 99Trace never matches people by a typed e-mail address.

SetupLink to this section

  • Order events go out through WP-Cron; if it does not run, orders are sent late.
  • Sends only to PostHog. For Meta or Google Ads, use PostHog's destinations, and leave anonymous orders out: they carry the shop server's IP address.
  • Other PostHog plugins are detected only when their folder or file name contains "posthog"; remove other snippets and tags yourself.

Next: install and set up 99Trace →