Amazon and ecommerce analytics
How to set up GA4 ecommerce tracking
The short answer
Send Google's recommended ecommerce events (view_item_list, view_item, add_to_cart, begin_checkout, add_shipping_info, add_payment_info, purchase and refund) with an items array on each, and on purchase always include transaction_id, value and currency. Most store platforms have an official or app-based GA4 integration that sends these for you; check it in DebugView, then compare GA4 revenue with your store's orders for a week.
On this page 6 sections
The events
| Stage | Recommended events |
|---|---|
| Browse | view_item_list, select_item, view_item, view_promotion, select_promotion |
| Cart | add_to_cart, remove_from_cart, view_cart, add_to_wishlist |
| Checkout | begin_checkout, add_shipping_info, add_payment_info |
| Outcome | purchase, refund |
Use these exact names. They populate GA4's monetisation reports and the purchase journey, and they import cleanly into Google Ads.
What each event must carry
- items: an array with item_id or item_name on every item (both is better), plus price, quantity (defaults to 1), item_brand, item_category and item_variant where you have them. An items array can hold up to 200 elements, and you can add up to 27 custom item parameters.
- purchase: transaction_id (required), value (the sum of price times quantity), currency (set it whenever you send value), and optionally tax, shipping and coupon.
- refund: the original transaction_id, plus the refunded items with item_id and quantity for a partial refund.
transaction_id is what stops a refreshed confirmation page from recording a second sale. Never leave it blank or send the same placeholder for every order.
Setting it up
- Check your platform first. Shopify, WooCommerce, BigCommerce and most others offer an official channel, app or plugin that sends the full event set. Use it rather than hand-building events.
- If you build it yourself, have developers push each event to the data layer with an ecommerce object, then send it with GTM GA4 Event tags (tick the option to send ecommerce data) or with gtag('event', 'purchase', {...}).
- Clear the ecommerce object before each push (dataLayer.push({ ecommerce: null })) so items from one event do not leak into the next.
- Test a real order in DebugView, then check Reports, Monetisation, Ecommerce purchases the next day.
Reconcile against the store
GA4 revenue will be lower than your store's: some buyers decline cookies, block scripts, or pay on a third-party page that never returns them to your confirmation page. Compare a week of orders by transaction ID. A gap of a few per cent is normal; a gap of a third means a broken event, duplicate tags, or a payment provider that skips your thank-you page. The store remains the record of orders; GA4 is for the path to them. More in analytics for Shopify stores and why GA4 numbers don't match.
Questions
- Is transaction_id required for GA4 purchase events?
- Yes. Google marks transaction_id as required for purchase and refund events. GA4 uses it to deduplicate purchases, so a reloaded confirmation page does not count the same order twice.
- How many items can a GA4 ecommerce event include?
- The items array can contain up to 200 elements, and each item can carry up to 27 custom parameters in addition to Google's prescribed item parameters.
- Why is GA4 revenue lower than Shopify revenue?
- GA4 misses buyers who decline analytics cookies, block scripts, or do not return to your confirmation page after an external payment step. The store's own order records are the source of truth for revenue; GA4 shows the journey.
Sources
Next step
Try the break-even roas calculator
Related guides
Analytics for Shopify stores: what to measure and how
Shopify analytics versus GA4, setting up the Google and YouTube app and customer events, the store metrics that matter, and when to add surveys or quizzes.
Why GA4 numbers don't match Google Ads, Shopify or your CRM
The usual reasons GA4 disagrees with Google Ads, Shopify, Search Console and your CRM: consent, ad blockers, attribution, dates, thresholds and definitions.
How to build a funnel exploration in GA4
Build a GA4 funnel exploration step by step: open vs closed funnels, directly vs indirectly followed by, elapsed time, next action and breakdowns, with a lead-gen example.
GA4 BigQuery export: set-up, limits and costs
How the free GA4 to BigQuery export works: daily vs streaming export, the 1 million events a day limit on standard properties, table names, sandbox, and what it costs.