Ecommerce events
Ecommerce events are messages a store's site sends to analytics at every step of the buyer's path: a product list shown, a product viewed, added to cart, checkout started, purchase, refund. They build the funnel, revenue by source and product reports.
In plain words
Without these events, analytics sees pages opened but does not understand what happens on them. With them you can see how many people looked at a product, how many put it in the cart and how many paid. For GA4, Google describes a recommended set of events; if you stick to its names, the standard reports and funnels work without extra setup.
The recommended GA4 event set
In the order of the buyer's path (Google documentation):
Step | Event |
|---|---|
Product list | `view_item_list`, `select_item` |
Product page | `view_item`, `add_to_wishlist` |
Cart | `add_to_cart`, `view_cart`, `remove_from_cart` |
Checkout | `begin_checkout`, `add_shipping_info`, `add_payment_info` |
Result | `purchase`, `refund` |
For promotions there are `view_promotion` and `select_promotion`.
What must be sent
According to Google's documentation:
- in `purchase` and `refund`, a `transaction_id` (a unique order number);
- in events with an amount, `currency` together with `value`;
- in `purchase`, `value` must equal the sum of "price × quantity" across all products;
- each product in the `items` array must have an `item_id` or `item_name` (Google recommends both); if quantity is not given, 1 is used;
- `items` can hold up to 200 elements;
- send all the parameters you have data for.
The old names `ecommerce_purchase` and `ecommerce_refund` were replaced by `purchase` and `refund`.
Example (illustrative numbers)
A buyer purchased a kettle for UAH 1,800 and two filters at UAH 250 each. The correct `purchase` event: `currency = UAH`, `value = 2,300`, `transaction_id = "A-10452"`, two rows in `items` (the kettle with quantity 1, the filter with quantity 2). If `value` is set to 1,800, revenue in reports will be understated, and if the event is sent twice with the same order number, overstated.
How to check the data
- Turn on DebugView. It shows events in real time but needs debug mode (Tag Assistant or the `debug_mode` parameter). If the user has not consented to analytics cookies, events will not appear (Google Analytics Help).
- Walk through the buyer's path by hand on a phone and a computer and compare the sequence of events with the table above.
- Place a test order and check the number, amount, currency and products against your accounting system.
- After a few days, compare the number of purchases and revenue in GA4 with the CRM. A small gap is normal (cookie refusals, cancellations); a large one is a reason to look for a bug.
- After every update of the site template, repeat a quick check: events break exactly then.
For standard reports, the number of parameters and events is limited; for key events, the name must be no longer than 40 characters (Google Analytics Help).
Common mistakes
- A duplicate `purchase` when the thank-you page is refreshed.
- Missing currency, or `value` that ignores quantity.
- Events sent before the user gave consent, or not sent at all because of the banner.
- Different event names on different pages (`add_to_cart` and `addToCart`).
- No `refund`: returns are not subtracted from revenue.
FAQ
Which events are required for a store? At minimum: `view_item`, `add_to_cart`, `begin_checkout`, `purchase`. The rest add detail to the funnel.
How do I check that `purchase` is not duplicated? Place a test order, refresh the thank-you page and look in DebugView for a second event with the same `transaction_id`.
Can events be sent from the server? Yes, see Server-side tracking.
Related terms
Sources
- Google, Measure ecommerce (GA4) — developers.google.com/analytics/devguides/collection/ga4/ecommerce
- Google Analytics Help, DebugView — support.google.com/analytics/answer/7201382
- Google Analytics Help, Event collection limits — support.google.com/analytics/answer/9267744
Related
Session recordings and heatmaps
A session recording is a replay of how one visitor used a site: where they moved the cursor, where they clicked, how they scrolled. A heatmap is a summary of such actions by many visitors on one page: where they click and how far they scroll. They show what…
LTV (customer lifetime value)
LTV (lifetime value, also CLV or CLTV) is the amount a customer brings to the store over the whole time of the relationship. For management decisions it is better to calculate it not in revenue but in margin: how much money the store keeps from all of the…
Incrementality and media mix models
Incrementality is the share of sales that advertising delivered on top of what the store would have received without it. If a person would have bought from you anyway, the ad added nothing with them, even though the report records them as a conversion. A…
CAC (customer acquisition cost)
CAC (customer acquisition cost) is the amount a store spends to get one new customer: all marketing and sales costs for a period divided by the number of customers who bought for the first time in that period.