Documentation
WooCommerce revenue attribution
Select WooCommerce in Settings → Revenue. Save a strong unique secret, then create two active webhooks at WooCommerce → Settings → Advanced → Webhooks: Order created (order.created) and Order updated (order.updated). Use the site's displayed /api/webhooks/woocommerce/SITE_ID delivery URL, the same secret for both, and WP REST API v3. Do not leave Secret empty, which lets WooCommerce choose a different value. Use a unique secret per store/site.
The X-WC-Webhook-Signature header is base64 HMAC-SHA256 over the raw JSON body. Every financial payload requires verification. WooCommerce's initial unsigned webhook_id=123 form probe receives a reachability acknowledgement only: it does not ingest data or mark the connection as receiving payments. Any other unsigned payload is rejected. There is no signed timestamp; provider financial IDs prevent duplicate recording. Webhook setup, official signature, topic and activation implementation.
Visitor IDs and WordPress plugin
Install AnalyticFast for WordPress 0.2.0+, enter the Site ID and analytics origin, then enable WooCommerce attribution under Settings → AnalyticFast. It copies the first-party ml_vid and ml_sid cookies into ml_visitor_id and ml_session_id order metadata. It supports classic checkout and Store API/Blocks checkout, uses WooCommerce CRUD (HPOS compatible), rejects malformed cookies, preserves existing metadata and honors the analyticfast_should_track consent filter. No payment credentials belong in the plugin. Cookie attribution remains an untrusted matching hint and cannot authorize analytics access.
The option defaults off. Without cookies/consent, no IDs are copied. Custom server checkouts can set the same metadata keys explicitly. Webhooks return them in meta_data: [{key,value}]. The plugin does not identify logged-in buyers or copy email addresses. Checkout hooks.
Orders, refunds and subscriptions
An order with processing or completed status must also have date_paid_gmt. An unpaid pending/on-hold/COD order does not record revenue. A refunded snapshot with a paid timestamp can recover the original order before applying its refunds. Integer minor units are converted exactly from decimal total, including zero-decimal JPY; GMT timestamps are interpreted as UTC. Customer ID 0 is a guest and never becomes a shared customer identity.
There is no standard WooCommerce refund.created topic. order.updated includes individual refunds[] with IDs and negative major-unit total values. The adapter subtracts each ID once, including multiple partial refunds, and handles refunds arriving before the paid snapshot. These are WooCommerce's recorded refunds; a manually logged refund does not prove a gateway returned money. Refunding dates use the order's date_modified_gmt because the summary omits refund creation dates. Removing a logged refund does not re-add revenue automatically. Changes to an order total after it is first recorded require server reconciliation.
WooCommerce core has no subscriptions. With WooCommerce Subscriptions, renewal orders use separate IDs and _subscription_renewal metadata when exposed by the extension/API; those are marked renewals. If this internal meta is hidden, repeat-customer attribution still matches later orders, but it cannot guarantee subscription classification. Subscriptions order helpers, renewal relationship implementation.
Product filters use numeric product IDs. Matching any line includes the whole order; revenue is not allocated between products. Customer email is parsed but shared storage discards webhook PII instead of identifying a visitor.
Order schema, refund summary serialization. Send test event previews locally with no writes. Validate checkout, a paid order, partial and full refunds in a real WordPress/WooCommerce test installation before production. References reviewed 2026-11-12.