E-commerce events
A standard e-commerce taxonomy with revenue and AOV queries.
viewed_product → added_to_cart → started_checkout → completed_checkout → refundedSuggested taxonomy
Event
When
Required properties
Instrument the storefront
import { track } from "@millimetric/track";
export function ProductPage({ product }: { product: Product }) {
useEffect(() => {
track("viewed_product", {
product_id: product.id,
price_cents: product.priceCents,
currency: "usd",
category: product.category
});
}, [product.id]);
return (
<button onClick={() => addToCart(product, 1)}>Add to cart</button>
);
}
function addToCart(product: Product, qty: number) {
cart.add(product, qty);
track("added_to_cart", {
product_id: product.id,
quantity: qty,
price_cents: product.priceCents,
currency: "usd"
});
}Track the order from the server
Refunds
Querying
Revenue per day
Average order value (AOV) by channel
Funnel: view → cart → checkout → order
Cohort retention (do they come back?)
Common pitfalls
See also
Last updated
Was this helpful?