What is recorded
An order that moves from Processing to Completed is stored once. A refund, partial or full, makes WooCommerce send the order again with every refund it has so far, and each refund is stored once. A refund you delete in WooCommerce stays recorded. The product is the order’s line item names. A deleted order keeps the sale that was recorded, because the money was paid. An order in a currency CrispStats does not know is skipped, and the row counts it.
WooCommerce payments are not read back from the store, so they never show as verified revenue. CrispStats checks the signature of every webhook with the secret it gave the store.
Test orders
WooCommerce has no test keys, so CrispStats leaves out test orders one by one, by the mark the payment gateway saves on the order:
To try a gateway that saves no test mark, use a staging copy of the store that is not connected to CrispStats.
Connect WooCommerce
You need an administrator account on the store, and the store must be reachable over https at a public address.1
Open the WooCommerce panel
In CrispStats, open the site’s Settings, then Revenue. Select Connect a payment provider and choose WooCommerce. During setup, the WordPress choice of the install step has the same form under I use WooCommerce.
2
Type the store address
Under Store address, type the address of your WordPress site, such as
https://shop.example.com. A site in a folder keeps its path, such as https://example.com/shop. CrispStats checks that WooCommerce answers there before it sends you on.3
Approve on the store
Select Connect WooCommerce. Your store opens its own screen and asks you to sign in as an administrator if you are not, then to approve CrispStats with Read/Write access. Select Approve.
4
Come back to CrispStats
The store sends you back to Revenue. CrispStats adds its webhooks to the store, and a message confirms that WooCommerce is connected. If something went wrong, the WooCommerce panel opens again with the cause under Store address.
5
Install the plugin
Without the plugin, orders are counted but not tied to visits. See link orders to visits.
Why Read/Write
CrispStats only reads orders, but WooCommerce gives a read-only key no way to create webhooks. The key is used to add the three webhooks when you connect and to remove them when you disconnect. CrispStats keeps the key encrypted and never changes orders, products or customers.What it adds to the store
Three webhooks named CrispStats revenue attribution, for Order created, Order updated and Order deleted. You see them in WooCommerce, Settings, Advanced, Webhooks, and the key under REST API.Connect again
Connecting the same store again, to replace a revoked key for example, adds a new set of webhooks first. The old set keeps delivering until the new connection is saved, then CrispStats removes it, so no order is missed during the switch. If connecting again fails, the old connection and its webhooks stay as they were.If the store refuses
Link orders to visits
The CrispStats WordPress plugin saves the visitor id of the current visit on each order at checkout, in the classic checkout and the block checkout, as the order fieldcrispstats_visitor_id. CrispStats reads it from the webhook and credits the order to that visit’s source, campaign and pages.
- Install the plugin and paste your site key. See install on WordPress.
- In Settings, CrispStats, check that Link orders to visits is on. It shows when WooCommerce is active and is on by default.
crispstats_visitor_id, with the id that crispstats.id() resolves to in the browser.