E-commerce
eodia analytics follows the purchase journey through an event convention, aligned with GA4
names to ease a migration. These eight events are predeclared and are the only ones that
accept a list of items, items.
| Event | When to send it |
|---|---|
view_item_list | a product list is displayed (category, results, selection) |
view_item | a product page is displayed |
add_to_cart | items are added to the cart |
remove_from_cart | items are removed from it |
begin_checkout | the checkout begins |
add_payment_info | the payment method is entered |
purchase | the order is placed |
refund | the order is refunded, in full or in part |
An order
Section titled “An order”EodiaAnalytics.track('purchase', { transaction_id: 'C-2026-10412', value: 129.9, currency: 'EUR', tax: 21.65, shipping: 4.9, coupon: 'AUTOMNE', items: [ { id: 'KA2', name: 'Kerys Air 2', category: 'Audio', brand: 'Kerys', variant: 'noir', price: 125, quantity: 1 }, ],})| Property | Events | Role |
|---|---|---|
currency | all | the currency, ISO 4217 code (EUR) |
value | all | the total value of the action, in the currency |
transaction_id | purchase, refund | the unique identifier of the order |
tax, shipping, coupon | purchase, refund | taxes, shipping costs, discount code |
item_list | view_item_list | the name of the list |
items | all | the items, 50 at most |
An item carries at least an id or a name, and, optionally: category, brand, variant,
price, quantity, coupon, discount.
EodiaAnalytics.track('add_to_cart', { currency: 'EUR', value: 59, items: [{ id: 'PL-ROUGE', name: 'Plaid Arvor', category: 'Maison', variant: 'rouge', price: 59, quantity: 1 }],})An order counts once
Section titled “An order counts once”The analytics.purchases view keeps one row per transaction_id: a reloaded confirmation
page, or an order sent by both the browser and the server, does not double the revenue. Amounts
sent by the site’s server take precedence; received tells how many sends arrived,
confirmed whether the server confirmed.
refund counts as negative, for the whole order or for some items (with items).
What the views provide
Section titled “What the views provide”analytics.purchases: one row per order or refund (amount, currency, taxes, shipping, coupon, number of items, visit), and the channel through a join withsessions;analytics.commerce_items: one row per item and per step:step, product, category, brand, variant, price, quantity,revenue(price × quantity);analytics.attribution: each order attributed to the visits that preceded it, according to six models. See attribution.
-- This week's purchase funnel, step by stepSELECT step, count(DISTINCT session_id) AS visitsFROM analytics.commerce_itemsWHERE day >= current_date - INTERVAL '7' DAYGROUP BY stepCurrencies
Section titled “Currencies”No conversion: currency is a column. Dashboards filter or group on it. A site that sells in
several currencies keeps its amounts as they are.
A goal (Metadata tab) can target an event, purchase for example, and take its value,
value, or a fixed value. The analytics.conversions view carries this value.
More reliable: from the server
Section titled “More reliable: from the server”The browser may never display the confirmation page: a three-step payment, a closed tab, a blocker. The most reliable order is sent from your server, once the payment is confirmed. See server-side collection.
eodia analytics is free software by Eodia.