Skip to content

Amazon and ecommerce analytics

How to set up GA4 ecommerce tracking

By the editors of Analytics1.comLast reviewed 19 October 20262 min read

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
  1. The events
  2. What each event must carry
  3. Setting it up
  4. Reconcile against the store
  5. Questions
  6. Sources

The events

StageRecommended events
Browseview_item_list, select_item, view_item, view_promotion, select_promotion
Cartadd_to_cart, remove_from_cart, view_cart, add_to_wishlist
Checkoutbegin_checkout, add_shipping_info, add_payment_info
Outcomepurchase, 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

  1. 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.
  2. 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', {...}).
  3. Clear the ecommerce object before each push (dataLayer.push({ ecommerce: null })) so items from one event do not leak into the next.
  4. 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