GA4 Ecommerce Tracking: How to Set It Up Correctly with Google Tag Manager (2026 Guide)
GA4 ecommerce tracking means sending Google Analytics 4 a set of recommended ecommerce events, from viewing a product to completing a purchase, each with an items array describing the products involved. When it’s set up correctly, GA4’s Monetisation reports show revenue, product performance and the shopping funnel, and the same purchase data can feed Google Ads.
This guide shows how to set it up with Google Tag Manager, what each event needs, how Shopify and WooCommerce differ, and how to test it before you trust the numbers.
Key takeaways
- GA4 ecommerce uses specific event names (
view_item,add_to_cart,begin_checkout,purchaseand others). Custom names won’t fill the ecommerce reports. - Every ecommerce event needs an
itemsarray. Purchases also needtransaction_id,valueandcurrency. - The cleanest setup is a data layer on your site plus GA4 event tags in GTM.
- Test every event in GTM Preview and GA4 DebugView, then compare GA4 purchases with your store’s orders.
The GA4 ecommerce events
GA4 has a fixed list of recommended ecommerce events. You don’t need all of them, but the more of the funnel you send, the more you can see.
| Stage | Event | When it fires |
|---|---|---|
| Browse | view_item_list | A list of products is shown (category page, search results) |
| Browse | select_item | A product is clicked in a list |
| Product | view_item | A product page is viewed |
| Cart | add_to_cart | A product is added to the cart |
| Cart | remove_from_cart | A product is removed |
| Cart | view_cart | The cart is viewed |
| Checkout | begin_checkout | Checkout starts |
| Checkout | add_shipping_info | Shipping details are submitted |
| Checkout | add_payment_info | Payment details are submitted |
| Order | purchase | The order is completed |
| Order | refund | An order is refunded |
| Promotions | view_promotion, select_promotion | Internal banners are shown or clicked |
Minimum useful setup: view_item, add_to_cart, begin_checkout and purchase. That gives you a basic funnel and accurate revenue.
What each event needs: the items array
Every ecommerce event carries an items array. Each item needs at least an item_id or item_name. Add as much detail as you can, because GA4’s product reports are built from these fields.
items: [{
item_id: 'SKU_12345',
item_name: 'Organic Cotton T-Shirt',
item_brand: 'YourBrand',
item_category: 'Apparel',
item_category2: 'T-Shirts',
item_variant: 'Blue / M',
price: 29.00,
quantity: 2,
discount: 3.00,
coupon: 'SUMMER10'
}]
Keep item_id the same as the ID in your product feed. That makes GA4, Google Ads and Merchant Center data line up.
The purchase event
The purchase is the event that matters most for revenue reporting and Google Ads bidding. It needs:
transaction_id: your order number. It must be unique, because GA4 uses it to avoid counting the same purchase twice.value: the order value you want to report. Decide whether that includes shipping and tax, and keep it consistent.currency: a three-letter code such asUSD,GBP,CAD,AUDorEUR. GA4 needs it whenevervalueis sent, otherwise revenue isn’t recorded correctly.items: the products in the order.- Optional but useful:
tax,shippingandcoupon.
Example data layer push on the order confirmation page:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ ecommerce: null }); // clear the previous ecommerce object
window.dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: 'ORDER_10458',
value: 55.00,
tax: 4.58,
shipping: 5.00,
currency: 'USD',
coupon: 'SUMMER10',
items: [{
item_id: 'SKU_12345',
item_name: 'Organic Cotton T-Shirt',
price: 25.00,
quantity: 2
}]
}
});
The ecommerce: null push clears the previous event’s data, so items from an earlier add_to_cart don’t leak into the purchase. Google recommends it before every ecommerce push.
Step-by-step setup in Google Tag Manager
Step 1: Install the Google tag for GA4
In GTM, add a Google tag with your GA4 Measurement ID (G-XXXXXXX), firing on Initialization – All Pages (or All Pages). If you use Consent Mode, make sure the consent default fires first. See Consent Mode v2 setup in GTM.
Step 2: Add the data layer to your site
Your site or platform must push the ecommerce events shown above. This is the part most setups get wrong. Every event needs real product data, the right event name, and only fires when the action actually happens. If you’re building it from scratch, the free data layer spec generator gives you a starting point, and the GA4 payload builder shows what each event should contain.
Step 3: Create a trigger for each event
Create Custom Event triggers named exactly like the data layer events: view_item, add_to_cart, begin_checkout, purchase. Or use one trigger with a regex such as view_item|add_to_cart|begin_checkout|purchase.
Step 4: Create the GA4 event tags
For each event, create a Google Analytics: GA4 Event tag:
- Event name:
{{Event}}(the built-in variable), or type the name. - Under More settings → Ecommerce, tick Send Ecommerce data and choose Data Layer as the source.
- Fire it on the matching trigger.
GTM then reads the ecommerce object from the data layer and sends the items, value, currency and transaction ID for you.
Step 5: Mark purchase as a key event
In GA4, go to Admin → Events (or Key events) and make sure purchase is marked as a key event. If you import GA4 conversions into Google Ads, this is the event you import. Many stores use the Google Ads conversion tag directly instead, for faster and more complete bidding data.
Shopify and WooCommerce
Shopify
Shopify’s checkout runs in a sandbox, so normal GTM scripts can’t run on the checkout and thank-you pages the way they do elsewhere. Your options:
- Google & YouTube app: the quickest way to send GA4 ecommerce events, but with limited control.
- Customer events (custom pixels): subscribe to Shopify’s checkout events and push them to GA4 or a server container.
- Server-side tracking: send purchases from Shopify’s order data, which survives ad blockers and closed tabs. See the server-side tracking guide.
Use one method for purchases, not two. Running the app and your own GTM purchase tag together is the most common cause of double-counted revenue. If GA4 and Shopify don’t agree, read why GA4 revenue doesn’t match Shopify.
WooCommerce
WooCommerce runs on your own WordPress site, so a data layer plugin (such as GTM4WP) or a custom data layer can push the full set of events. The weak spot is the order received page: off-site payment gateways and customers who close the tab before it loads mean lost purchases. See WooCommerce GA4 missing purchases.
Custom checkouts and third-party payment pages
If customers pay on Stripe, PayPal or a booking tool on another domain, you need cross-domain tracking or a server-side purchase. See Stripe third-party checkout tracking.
How to test GA4 ecommerce tracking
- GTM Preview: walk through the full journey (product, cart, checkout, purchase) and check that each event fires once, with the right items.
- GA4 DebugView (Admin → DebugView): confirm the events arrive with the
itemsarray and, for purchases,transaction_id,valueandcurrency. - Network check: look at the requests to
google-analytics.com/g/collect. Paste one into the free GA4 request decoder to see every parameter GA4 received. - Place a real test order with a discount code, and check the revenue matches what you expect.
- After 24–48 hours, open Reports → Monetisation → Ecommerce purchases, then compare transactions and revenue with your store’s orders for the same days.
Common mistakes that break GA4 ecommerce data
- Custom event names like
addToCartororder_complete. GA4’s ecommerce reports only use the recommended names. - Missing currency, so revenue doesn’t appear.
- Purchase fires on every reload of the thank-you page. A unique
transaction_idhelps GA4 deduplicate, but it’s better to fire the purchase only once. - No
ecommerce: nullclear, so old items leak into the next event. - Value includes the wrong things: tax and shipping in some events but not others.
- Two purchase sources, such as a platform app plus your own tag.
- Item IDs that don’t match your product feed, which breaks reporting across GA4, Google Ads and Merchant Center.
- Consent banner blocks GA4 entirely instead of using Consent Mode, so you lose all modelled data.
The free GA4 parameter validator catches many of these before they reach your reports. For a full review of your setup, use the GA4 audit checklist.
Frequently asked questions
Does GA4 track ecommerce automatically?
No. Enhanced measurement tracks page views, scrolls and some clicks, but not products, carts or purchases. Ecommerce events have to be sent by your site, a platform integration or GTM.
Where do I see ecommerce data in GA4?
In Reports → Monetisation: Ecommerce purchases (products), Purchase journey and Checkout journey. You can also build funnel explorations in Explore.
Can I track ecommerce in GA4 without Google Tag Manager?
Yes, with gtag.js code on your site or a platform integration. GTM is easier to manage and test, especially when the same data also goes to Google Ads, Meta and other platforms.
Why are my GA4 purchases lower than my store’s orders?
Ad blockers, consent choices, payment redirects and thank-you pages that never load all lose browser purchases. Some gap is normal. A large one usually means a fixable setup problem, or a sign you’d benefit from server-side purchase tracking.
Need GA4 ecommerce tracking set up or fixed?
I’m Jobair Mahmud, a GA4 and conversion tracking consultant. I build ecommerce data layers and GA4 tracking for Shopify, WooCommerce and custom stores in the US, UK, Canada and Australia, and fix setups where revenue doesn’t match. See my ecommerce data layer service and GA4 and GTM tracking service, or book a free tracking audit.
🛒 Missing Revenue or Duplicate Purchases in GA4?
Whether you run on Shopify Checkout Extensibility, WooCommerce, Magento, or BigCommerce, I build custom DataLayer architectures that guarantee 100% order reconciliation and full-funnel visibility.
- E-Commerce Brands: Schedule a 15-Min Technical Scope Call or explore Ecommerce DataLayer Services.
- E-Commerce Agencies: We handle Shopify Web Pixels & Magento tracking for your clients. Partner with Us Under NDA.
Need this implemented, audited, or white-labeled?
Whether you are an eCommerce brand owner fixing signal loss or a digital marketing agency needing a senior analytics engineer under strict NDA, I deliver 24–48h SLA turnaround with 8.5+ EMQ match rates.
