For an online store, analytics without ecommerce tracking is like a shop counter without a till. You can see people walking in, but not what they looked at, what they put in the basket or what they actually bought. Google Analytics 4 does not collect that information automatically; you have to send it.
This guide explains how GA4 ecommerce tracking works, which events and parameters to send, the main ways to implement it on Shopify, WooCommerce and custom stores, how to test it, and which reports to use once data is flowing. It is written for store owners and marketers who need accurate revenue data, not just developers.
New to GA4's event model? Start with our explainer on GA4 events, then come back here.
Key Takeaways
- GA4 ecommerce relies on recommended events such as view_item, add_to_cart, begin_checkout and purchase.
- Each event should carry an
itemsarray with consistent item IDs, names, prices and quantities. - Purchases need a unique
transaction_id, and if you sendvalueyou must also sendcurrency. - Use a platform integration or a Google Tag Manager data layer rather than hand-coding events page by page.
- Reconcile GA4 revenue against your store's back end regularly; small gaps are normal, large ones are not.
How GA4 ecommerce tracking works
GA4 treats everything as an event. Ecommerce tracking means sending a defined set of recommended events at each stage of the shopping journey, with product details attached. Google's developer guide to measuring ecommerce covers selecting items from lists, viewing item details, adding and removing cart items, starting checkout, purchases, refunds and promotions.
| Shopping stage | Event | When it fires |
|---|---|---|
| Browsing lists | view_item_list, select_item | Category or search results viewed; product clicked |
| Product page | view_item | Product detail page viewed |
| Basket | add_to_cart, remove_from_cart, view_cart | Cart changes and cart page views |
| Wishlist | add_to_wishlist | Item saved for later |
| Checkout | begin_checkout, add_shipping_info, add_payment_info | Checkout started and each step completed |
| Order | purchase | Order confirmed |
| After sale | refund | Full or partial refund issued |
| Promotions | view_promotion, select_promotion | Internal banners seen or clicked |
The items array and required parameters
The items array is where product data lives. Each item can include item_id, item_name, item_brand, item_category (up to item_category5), item_variant, price, quantity, coupon and more. Keep IDs identical across every event so GA4 can join the journey together.
Two rules trip up many stores. First, Google's sample purchase code marks the transaction ID as required for purchases and refunds. Second, value and currency go together:
“If you set value then currency is required for revenue metrics to be computed accurately.”
— Google for Developers, Recommended events reference
A minimal purchase event through the data layer looks like this:
dataLayer.push({ ecommerce: null });
dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "T_10421",
value: 84.50,
tax: 7.04,
shipping: 4.99,
currency: "GBP",
coupon: "AUTUMN10",
items: [{
item_id: "SKU_1234",
item_name: "Merino Crew Jumper",
item_category: "Knitwear",
item_variant: "Navy",
price: 39.75,
quantity: 2
}]
}
});
Clearing the previous ecommerce object first prevents data from one event leaking into the next.
Implementation options
| Platform | Typical approach | Watch out for |
|---|---|---|
| Shopify | Google & YouTube app or a custom pixel feeding GTM | Checkout runs in a restricted environment; test purchase events carefully |
| WooCommerce | A GA4 integration plugin or a GTM data layer plugin | Duplicate tags if a theme or Site Kit also sends GA4 |
| Custom or headless store | Developer-built data layer plus GTM | Single-page apps need virtual page views and careful event timing |
| Marketplace or hosted checkout | Server-side or Measurement Protocol for purchases | Cross-domain tracking and session continuity |
If you are still deciding on a platform, our comparison of Shopify vs WooCommerce covers tracking flexibility among other factors. WordPress stores should also follow our GA4 WordPress setup guide to avoid double tagging.
Step-by-step setup with Google Tag Manager
- Plan the events you need and document item parameters in a simple tracking plan.
- Get a data layer in place, either from a platform plugin or from your developer, pushing the events above.
- Create a GA4 Event tag in GTM for each ecommerce event (or one tag using the event name variable) and tick the option to send ecommerce data from the data layer.
- Create Custom Event triggers matching each event name.
- Preview and test with GTM Preview and GA4 DebugView, completing a real test order.
- Mark purchase as a key event in GA4 if it is not already; see GA4 key events.
- Publish, then reconcile GA4 orders and revenue against your store admin after a week.
Our Google Tag Manager guide explains containers, variables and preview mode if any of those steps are unfamiliar.
Key ecommerce reports in GA4
Once events flow, GA4's Ecommerce purchases report shows performance by item name, ID, brand and category, with metrics such as items viewed, items added to cart, items purchased and item revenue. Google notes these events are not collected automatically. Other useful places to look:
- Monetization overview: total revenue, purchasers and average purchase revenue at a glance.
- Checkout journey and purchase journey: where shoppers drop out between steps. Pair with our guide to checkout optimisation.
- Promotions and order coupons: which banners and discount codes actually drive sales.
- Traffic acquisition with revenue: which channels bring buyers, not just visitors.
- Explorations: build funnels and product-level analysis; see GA4 explorations.
Common mistakes in GA4 ecommerce tracking
- Duplicate purchases. The thank-you page reloads or is revisited and fires purchase again. Always send a unique transaction ID.
- Missing currency. Revenue appears as zero or is miscalculated when value is sent without currency.
- Inconsistent item IDs. Using SKU on one event and product name on another breaks product reports.
- Tracking only purchase. Without the funnel events you cannot see where shoppers drop out.
- Counting your own test orders. Exclude staff traffic with our guide to excluding internal traffic in GA4.
- Expecting a perfect match with the store. Ad blockers and consent choices mean GA4 will usually show fewer orders than your back end.
Related Guides
- How to Track Form Submissions in GA4 and GTM
- How to Exclude Internal Traffic in GA4
- Incrementality Testing: Prove Which Marketing Actually Works
Frequently Asked Questions
Does GA4 track ecommerce automatically?
No. Enhanced measurement collects page views, scrolls and similar interactions, but ecommerce events such as add_to_cart and purchase must be implemented.
Why does GA4 revenue not match my Shopify or WooCommerce revenue?
Consent choices, ad blockers, refunds, taxes and shipping settings and duplicate or missing purchase events all cause gaps. Investigate if the difference is large or suddenly changes.
What is the items array in GA4?
It is a list of products attached to an ecommerce event. Each item carries details such as item ID, name, category, price and quantity.
Do I need Google Tag Manager for GA4 ecommerce?
Not always. Some platform integrations send the events directly. GTM gives more control and makes it easier to add other tags such as ads conversions.
How do I track refunds in GA4?
Send a refund event with the original transaction ID. For partial refunds, include the refunded items and quantities.
Conclusion
Accurate GA4 ecommerce tracking turns your analytics from a traffic counter into a revenue tool. Send the full set of recommended events with clean item data, test with real orders and reconcile regularly. Then use the reports to fix leaky funnels and invest in the products and channels that sell. If you want help growing online sales on top of solid data, see our ecommerce SEO services or get a quote.



