GA4 for an online store
GA4 (Google Analytics 4) is Google's free web analytics system. It collects site visitors' actions as "events" (product view, add to cart, purchase) and shows where buyers come from and where they drop off. For a store it is useful only when ecommerce events and key events are set up.
In plain words
In GA4 everything is an event: opening a page, a click, a purchase. An installed system on its own will show traffic, but it won't show how much money advertising brought in unless you pass it order data. So for a store, setup comes down to five steps.
What to set up
- Ecommerce events. Google has a recommended set of events from `view_item_list` to `purchase` and `refund`. `purchase` requires a `transaction_id`, the `value` must equal the sum of price × quantity across all items, and the currency (`currency`) is always specified when there is an amount (Google developer documentation). In detail, see Ecommerce events.
- Key events. Any collected event can be marked as a key event, meaning one that measures an action important to the business (Google Analytics Help). For a store these are usually a purchase and a submitted request; don't mark everything as key, or the reports lose their meaning. The name of an event marked as key must be no longer than 40 characters (Google Analytics Help).
- Data retention. It affects only Explorations and funnel reports, not standard reports. The maximum for a standard property is 14 months (Google Analytics Help). If you need year-over-year comparisons in funnels, extend the period right away, not after the data has disappeared.
- BigQuery export. Free within the BigQuery sandbox; for a standard property the export limit is 1 million events per day (Google Analytics Help). It is a way to keep raw data with no retention limit (see Data warehouse).
- User consent. If the cookie banner doesn't pass the consent state, some events don't reach the data. DebugView, for example, won't show events if there is no consent for analytics cookies (Google Analytics Help). See Consent Mode and Cookie banner.
How to check that everything works
Turn on DebugView (Admin → Data display): it shows events in real time, but only after debug mode is enabled via Tag Assistant or the `debug_mode` parameter. Place a test order and compare it with what arrived in GA4. On checking, see Ecommerce events and data validation.
Common mistakes
- A duplicate `purchase` when the "Thank you for your order" page is refreshed: the event is sent twice with the same `transaction_id`.
- Passing an amount without a currency.
- Calculating conversion from GA4 data and from CRM data and being surprised the numbers differ: GA4 doesn't see buyers who didn't consent, phone orders and cancelled orders (those must be passed as a separate `refund` event).
- Looking only at sessions, not at revenue by source.
FAQ
Is GA4 free? Yes, the basic version is free. Paid versions (360) have higher limits.
How long does GA4 keep data? For explorations and funnels, up to 14 months in a standard property. Standard reports aren't limited by this setting.
Why doesn't revenue in GA4 match the CRM? Reasons: cookie refusals, cancelled and returned orders, orders by phone or messengers, duplicate events. The accounting system is always the reference for finances; GA4 is for directions.
What is a key event? An event you marked as important to the business, for example `purchase`.
Related terms
- Ecommerce events
- Funnel analysis
- The store owner's dashboard
- Data warehouse
- Server-side tracking
- Google Consent Mode v2
- Key metrics of an online store: what to watch daily, weekly and monthly
Sources
- Google, Measure ecommerce (GA4), developer documentation — developers.google.com/analytics/devguides/collection/ga4/ecommerce
- Google Analytics Help, Events and key events — support.google.com/analytics/answer/9267568
- Google Analytics Help, Event collection limits — support.google.com/analytics/answer/9267744
- Google Analytics Help, Data retention — support.google.com/analytics/answer/7667196
- Google Analytics Help, BigQuery Export — support.google.com/analytics/answer/9358801
- Google Analytics Help, DebugView — support.google.com/analytics/answer/7201382
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.