PureStats documentation
E-commerce analytics
Measure orders, revenue, products, checkout progression, refunds and campaign attribution without sending customer data.
PureStats understands the standard commerce events view_item, add_to_cart, begin_checkout, purchase and refund. Commerce reporting is optional and uses the same consent, path exclusion and traffic classification rules as other analytics events.
Set the reporting currency
Open Site Settings → General and select the currency used for the main commerce report. Orders in other currencies remain visible as separate totals. PureStats never combines currencies without an explicit exchange rate.
Track a product view
window.purestats?.track('view_item', {
items: [{
item_id: 'product-42',
sku: 'PS-42',
name: 'Analytics Handbook',
category: 'Books',
price: 29.00,
quantity: 1
}]
});
Use the same items structure for add_to_cart and begin_checkout.
Track a purchase
window.purestats?.track('purchase', {
order_id: 'order-10042',
value: 58.00,
currency: 'EUR',
tax: 9.26,
shipping: 0,
discount: 0,
items: [{
item_id: 'product-42',
sku: 'PS-42',
name: 'Analytics Handbook',
category: 'Books',
price: 29.00,
quantity: 2
}]
});
order_id makes purchases idempotent. Sending the same order again updates the normalized order instead of creating a second order. PureStats encrypts the reference and only shows a non-reversible fingerprint in analytics.
Track a refund
window.purestats?.track('refund', {
order_id: 'order-10042',
refund_id: 'refund-204',
value: 29.00,
currency: 'EUR'
});
The original purchase must exist before its refund. refund_id provides retry-safe deduplication.
Privacy and validation
Commerce payloads accept product and financial fields only. Do not send names, email addresses, phone numbers, delivery addresses or payment details. Unknown commerce fields are rejected rather than stored.
The Commerce report includes gross and net revenue, orders, average order value, refunds, checkout progression, products and acquisition attribution. Commerce can also be included in scheduled reports, CSV exports, visitor sessions, experiments and revenue-drop alerts.