GA4 Ecommerce Tracking: Purchase and Product Events
GA4 only reports product views, carts, checkouts and sales if your store sends ecommerce events in the format Google sets. This guide covers the events, the items array, the purchase event, transaction IDs, currency, refunds, the Shopify and WooCommerce routes, the reports and how to fix missing revenue.
This guide uses Google's own documentation: the developer guide Measure ecommerce, the recommended events reference, and Analytics Help on setting up ecommerce events. Store platform details come from Shopify's and WooCommerce's own help pages, linked where they are used.
What GA4 ecommerce tracking is
GA4 ecommerce tracking is a set of recommended events with fixed names and parameters, such as view_item, add_to_cart and purchase, that describe how people shop on your site. Google is clear that these do not appear on their own: "Ecommerce events are not collected by Google Analytics automatically." Because they need extra context, such as which product and at what price, your site, your Tag Manager container or your store platform has to send them.
Once they arrive with the right names, GA4 fills its ecommerce dimensions, metrics and reports by itself. Google's advice is to use these events "instead of creating your own custom events", because only the recommended names get that treatment. If a site sends business-specific details on top, those are custom parameters, which our GA4 custom events and dimensions guide covers. If you are new to GA4, start with our Google Analytics 4 basics.
The ecommerce events, step by step
Google's developer guide groups the events by the shopping step they measure:
| Step | Event | When to send it |
|---|---|---|
| Product lists | view_item_list, select_item | A list of products is shown; a product in it is clicked |
| Product page | view_item | Someone views an item's details |
| Cart and wishlist | add_to_cart, remove_from_cart, view_cart, add_to_wishlist | Items go in or out of the cart, the cart is viewed, an item is saved |
| Checkout | begin_checkout, add_shipping_info, add_payment_info | Checkout starts; shipping details (with shipping_tier) and payment details (with payment_type) are submitted |
| Order | purchase, refund | An order is completed; some or all of it is refunded |
| Internal promotions | view_promotion, select_promotion | A banner or promotion on your own site is seen or clicked |
You do not need every event on day one. A small store gets most of the value from view_item, add_to_cart, begin_checkout and purchase, because those four give you a basic funnel; that order is our suggestion, not Google's. For promotions, Analytics Help adds one rule worth knowing: to connect a sale to a promotion, add promotion_id or promotion_name "to every subsequent ecommerce event."
On a plain website, ecommerce events can go anywhere below the Google tag. With Google Tag Manager, the event goes into the data layer and a GA4 event tag sends it, with one row per event-level parameter. Our Google Tag Manager basics guide explains containers, tags and triggers.
The items array and item parameters
Products travel in an items array inside each event. Analytics Help draws the line: information about the products "belongs at the item level", while information about the interaction, such as the order total, belongs at the event level, outside the array. The limits and rules from Google's developer guide:
- Each item needs
item_idoritem_name; Google recommends sending both. quantitydefaults to 1 if you leave it out.- The array can hold up to 200 items.
- You can add up to 27 custom parameters per item on top of Google's own.
- Google's advice is to set every ecommerce parameter you have data for, "regardless of whether the parameter is optional."
The prescribed item parameters include price, quantity, discount (a per-unit discount), coupon, item_brand, item_variant, index (position in a list), item_list_id and item_list_name, and five category levels, item_category to item_category5. In Google's example, Apparel/Mens/Summer/Shirts/T-shirts maps to the five levels in that order. Item-level and event-level coupons are independent of each other.
The purchase event
The events reference lists what a purchase carries. Required: transaction_id and items. value and currency carry an asterisk: value is "typically required for meaningful reporting", and currency is required whenever you set value. Optional: tax, shipping, coupon and customer_type. This is Google's own example, shortened:
gtag("event", "purchase", {
transaction_id: "T_12345",
// Sum of (price * quantity) for all items.
value: 72.05,
tax: 3.60,
shipping: 5.99,
currency: "USD",
coupon: "SUMMER_SALE",
customer_type: "new",
items: [ /* one object per product */ ]
});
Two details trip up many setups. First, value is the sum of price times quantity for the items, and the reference says "Don't include shipping or tax"; those go in their own parameters. Second, customer_type takes new or returning, with a 540-day window "recommended and set at default, but not required", and Google says not to set it when you are unsure, for example after a guest checkout.
Analytics Help also warns that if a required parameter is missing, "the event will be treated as a custom event and won't appear in the report." A purchase without items is the usual example.
Transaction IDs and duplicate purchases
An order confirmation page can be reloaded or opened again later, which can fire the purchase event twice. Google's transaction ID page is the fix: "Google Analytics deduplicates purchase events with the same transaction ID." The rules on that page:
- Every order needs its own ID; an order confirmation number works. Letters, numbers, dashes and spaces are allowed.
- The same ID "shouldn't be used across different users."
- Never send an empty string. Google deduplicates all purchases with
transaction_id="", so they collapse into one. - The ID must leave out anything that could identify a customer, so no email addresses or names.
- Send a dynamic value. A hard-coded ID that repeats across orders "could significantly undercount your key events."
The same ID is what links a refund back to its purchase, which is the other reason Google says to add it "to every ecommerce event."
Currency and value
Google's currency reference says that if you set value, "then currency is required for revenue metrics to be computed accurately." The code is the three-letter ISO 4217 format, such as USD, EUR or GBP. Other points from that page:
- Reports show money in the property's currency, which is USD by default. You can change it in Property settings, and the change also converts historical data.
- If you sell in several currencies, send each order's own currency. GA4 converts it using "the prior day's exchange rate."
- The BigQuery export keeps raw transaction values in the local currency, not the reporting currency.
Refunds
The refund event covers full and partial refunds. It needs the original transaction_id; for item-level refund figures, include each refunded item with item_id and quantity. Analytics Help says to include the refunded items in an items array "regardless of whether you issue a full or partial refund." Refunds are often issued from an admin area rather than the shopper's browser, so plan where your refund event will come from before you rely on net revenue in GA4.
Shopify and WooCommerce
Most stores do not hand-code these events. The two platforms we compare in Shopify vs WooCommerce both have an official route. This is what their documentation says:
Shopify
Shopify's GA4 setup page has you create a GA4 property and web data stream, then install the Google & YouTube sales channel and follow Google's tag setup steps. After that, "certain ecommerce events are tracked automatically." Google's Ecommerce purchases report page names some of them: add_to_cart, begin_checkout and purchase. Other recommended events need setting up yourself. Shopify also notes that GA4 cannot track events until you turn off private mode for the online store.
WooCommerce
The free Google Analytics for WooCommerce extension takes your G- Measurement ID under WooCommerce > Settings > Integration > Google Analytics, and has tick boxes for purchases, add and remove from cart, list impressions and clicks, product views and checkout start. WooCommerce's own notes:
- Purchase tracking needs a payment gateway that sends the buyer back to the order received page after payment.
- The connection can take up to 48 hours to start working.
- Pageviews are not tracked for logged-in admin users, so test while logged out.
- The extension has no cookie banner. It works with the WP Consent API, and in the EEA, UK and Switzerland, visitors must grant consent before tracking starts, so your store and GA4 numbers can differ.
Consent affects every route, not only WooCommerce. Our cookie consent banners guide covers that side.
Where the data shows up
Google lists the Ecommerce purchases and Monetization overview reports as the ones that show ecommerce data automatically. The Ecommerce purchases report breaks results down by item name, ID, brand and the five category levels, with metrics such as item revenue (price × quantity, "excluding tax and shipping"), items viewed, items added to cart and items purchased. If you cannot find the report in the left menu, an Editor can add it back.
Google's ecommerce metrics page explains why two numbers can look different. Event-scoped metrics count events, item-scoped metrics count items. In Google's example, one add-to-cart with 3 of one shirt and 2 of another is 1 "Add to carts", with 3 and 2 "Items added to cart". Similarly, "Ecommerce purchases" counts only the purchase event, while "Purchases" also counts other purchase-type events such as in_app_purchase.
For funnels and deeper analysis, see our GA4 explorations guide. To turn shoppers into remarketing lists, such as people who started checkout but did not buy, see our GA4 audiences guide.
Testing and fixing missing revenue
Reports can take up to 24 hours to fill with ecommerce data, so test in real time instead: turn on debug mode and watch the events arrive, as our GA4 DebugView guide shows. Then place a real test order and check the purchase event's parameters.
If purchases arrive but revenue is empty, Google's missing revenue page lists the usual causes:
- A required parameter is missing:
currency,transaction_id,value,items, oritem_id/item_nameon the items. valueorpriceis sent as a string, in quotes, or with a currency symbol. "$100.00" should be 100.00, withcurrencyset to USD.- Parameter names are misspelled or not all lowercase, or
valueis inside the items array instead of at event level. - With Tag Manager, the event is right in the data layer but not mapped in the GA4 event tag, or the other way round.
Before launch, put this check on your list alongside the rest of our ecommerce launch checklist. If you also run Google Ads, the purchase can serve as a conversion there too; our Google Ads conversion tracking guide covers that.
Frequently asked questions
Does GA4 track ecommerce automatically?
No. Google says ecommerce events are not collected automatically; your site, Tag Manager or store platform must send them. Shopify's Google & YouTube channel and the Google Analytics for WooCommerce extension send some of them for you.
Should the purchase value include shipping and tax?
No. Google's events reference says to set value to the sum of price times quantity for the items and not to include shipping or tax. Send those in the separate shipping and tax parameters.
Why does GA4 show duplicate purchases?
Usually because the purchase event fires again when the confirmation page is reloaded and the event has no unique transaction ID. GA4 deduplicates purchases with the same transaction_id, so send the order number with every purchase.
Why is my GA4 purchase revenue zero?
Google's checklist points to a missing currency or value, value sent as text or with a currency symbol, a misspelled parameter, or value placed inside the items array instead of at event level.
Which GA4 reports show ecommerce data?
The Ecommerce purchases and Monetization overview reports show it automatically. Explorations, BigQuery and the Data API can use the same data.
Ecommerce tracking is only as good as the store behind it. See our website development service and all our services, or email [email protected].