GA4 Ecommerce Tracking: Complete Setup Guide
By Emily Redmond, Data Analyst at Emilytics · April 2026
TL;DR: GA4's ecommerce event schema tracks products, cart, checkout, and purchases. Fire the right events with item details, and GA4 automatically calculates metrics like revenue, AOV, and product performance.
If you're running an ecommerce store, GA4's ecommerce tracking is built for you. It's standardized (works across platforms), rich (captures product details), and powerful (enables ROI analysis and audience building). This guide walks you through the setup.
GA4 Ecommerce Event Schema
GA4 has a standard set of ecommerce events. Use them instead of custom events for best results.
| Event | When It Fires |
|---|---|
| view_item | User views a product detail page |
| view_item_list | User views a category/collection page |
| add_to_wishlist | User adds product to wishlist |
| add_to_cart | User adds product to cart |
| remove_from_cart | User removes product from cart |
| view_cart | User views cart page |
| begin_checkout | User starts checkout process |
| add_shipping_info | User adds shipping address/method |
| add_payment_info | User adds payment method |
| purchase | User completes purchase |
| refund | User initiates refund/return |
Each event has an items parameter containing product details (name, price, quantity, category, etc.).
Step 1: Map Your Events
Before you code, decide which ecommerce events apply to your store.
For Shopify, WooCommerce, or BigCommerce: Most ecommerce platforms auto-implement these events if you enable GA4. Check your platform's GA4 integration docs.
For custom code: Identify each touchpoint:
- Product page →
view_item - Add to cart →
add_to_cart - Cart page →
view_cart - Start checkout →
begin_checkout - Payment info →
add_payment_info - Order confirmation →
purchase
Step 2: Implement Each Event
view_item (User Views a Product)
Fire this event when a user lands on a product detail page.
gtag('event', 'view_item', {
items: [
{
item_id: 'product_12345',
item_name: 'Blue T-Shirt',
affiliation: 'Google Store',
coupon: 'SAVE10',
currency: 'USD',
discount: 5.00,
index: 0,
item_brand: 'My Brand',
item_category: 'Clothing',
item_category2: 'Shirts',
item_variant: 'Blue XL',
price: 49.99,
quantity: 1
}
]
});
Key parameters:
item_id: Your product SKUitem_name: Product nameitem_category: Category (for segmentation)price: Product pricecurrency: Currency code (USD, EUR, etc.)
Optional:
affiliation: Where the product is sold (your store name)item_variant: Size, color, styleitem_brand: Brand namecoupon: Any coupon applieddiscount: Discount amount (if applicable)
view_item_list (User Views a Category)
Fire when a user views a collection/category page (all products in one view).
gtag('event', 'view_item_list', {
items: [
{
item_id: 'product_12345',
item_name: 'Blue T-Shirt',
item_category: 'Clothing',
price: 49.99,
currency: 'USD'
},
{
item_id: 'product_67890',
item_name: 'Red T-Shirt',
item_category: 'Clothing',
price: 49.99,
currency: 'USD'
}
],
item_list_name: 'Best Sellers',
item_list_id: 'bestsellers'
});
Include all products shown in the list. Add item_list_name (what you call the list) for reporting.
add_to_cart
Fire when a user adds a product to their cart.
gtag('event', 'add_to_cart', {
items: [
{
item_id: 'product_12345',
item_name: 'Blue T-Shirt',
affiliation: 'Google Store',
currency: 'USD',
item_category: 'Clothing',
price: 49.99,
quantity: 2
}
],
value: 99.98,
currency: 'USD'
});
Key: Include the quantity (user might add 2 of the same item). Set value to the subtotal (price × quantity).
view_cart
Fire when a user views their cart.
gtag('event', 'view_cart', {
items: [
{
item_id: 'product_12345',
item_name: 'Blue T-Shirt',
currency: 'USD',
price: 49.99,
quantity: 2,
item_category: 'Clothing'
},
{
item_id: 'product_67890',
item_name: 'Red Shirt',
currency: 'USD',
price: 39.99,
quantity: 1,
item_category: 'Clothing'
}
],
value: 139.97,
currency: 'USD'
});
Include all items currently in the cart and the total cart value.
begin_checkout
Fire when a user starts the checkout process (clicks "Go to Checkout" button).
gtag('event', 'begin_checkout', {
items: [
{
item_id: 'product_12345',
item_name: 'Blue T-Shirt',
currency: 'USD',
price: 49.99,
quantity: 2,
item_category: 'Clothing'
}
],
value: 99.98,
currency: 'USD'
});
Same item details as cart, but fired at the start of checkout.
add_shipping_info (Optional)
Fire if you want to track shipping step separately.
gtag('event', 'add_shipping_info', {
items: [...],
value: 99.98,
currency: 'USD',
coupon: 'SAVE10',
shipping_tier: 'Ground'
});
add_payment_info (Optional)
Fire when user submits payment method.
gtag('event', 'add_payment_info', {
items: [...],
value: 99.98,
currency: 'USD',
coupon: 'SAVE10',
payment_type: 'credit_card'
});
purchase (The Big One)
Fire on the order confirmation page (after payment is processed).
gtag('event', 'purchase', {
transaction_id: 'order_12345',
affiliation: 'My Store',
value: 129.97,
currency: 'USD',
coupon: 'SAVE10',
tax: 10.00,
shipping: 20.00,
items: [
{
item_id: 'product_12345',
item_name: 'Blue T-Shirt',
affiliation: 'My Store',
coupon: 'SAVE10',
currency: 'USD',
item_category: 'Clothing',
price: 49.99,
quantity: 2
},
{
item_id: 'product_67890',
item_name: 'Red Shirt',
affiliation: 'My Store',
coupon: 'SAVE10',
currency: 'USD',
item_category: 'Clothing',
price: 39.99,
quantity: 1
}
]
});
Critical parameters:
transaction_id: Unique order ID (don't repeat)value: Total order value (including tax and shipping)currency: Currency codeitems: All products in the ordertax: Tax amountshipping: Shipping cost
💡 Emily's take: The most common mistake I see is firing a purchase event with the wrong
transaction_idformat or repeating the same ID for multiple orders. Always use a truly unique order ID. GA4 uses this to prevent duplicate counting.
Step 3: Mark Purchase as a Conversion
- Go to GA4 → Admin → Events
- Find
purchasein the list - Toggle Mark as conversion
- Save
Now GA4 treats every purchase as a conversion and shows it in conversion reports.
Step 4: Verify Implementation
In Real-Time
- Go to GA4 → Real-time
- Add a product to cart on your site
- Watch for
add_to_cartevent in real-time - Continue through checkout and complete a purchase
- Watch for
purchaseevent
Expand the purchase event to see the items, value, currency, etc. If everything looks right, you're good.
In Standard Reports
- Go to GA4 → Reports → Monetization (or Conversion if ecommerce isn't showing)
- You should see:
- Purchase events, revenue, average order value
- Products purchased
- Conversion funnels (cart → checkout → purchase)
GA4 Ecommerce Reports
Once events are firing, GA4 automatically creates ecommerce reports:
Monetization Reports
- Overview: Revenue, transactions, AOV
- Products: Which products sell most, revenue by product
- Shopping behavior: Funnel from cart view → checkout → purchase
Standard Explorations
Build custom reports. Examples:
| Question | Exploration |
|---|---|
| Which product category has highest AOV? | Dimension: item_category. Metric: Revenue per transaction. |
| Do customers who use coupons spend more? | Dimension: coupon. Metric: Revenue per user. |
| What's the cart abandonment rate? | Funnel: Add to cart → Begin checkout → Purchase. See drop-off. |
| Which traffic source drives highest-value orders? | Dimension: Source/medium. Metric: Revenue per transaction. |
Multi-Currency and International
If you sell in multiple currencies:
- Always specify
currencyin each event (don't assume) - GA4 shows all revenue in your property's primary currency
- The conversion rates are applied automatically
Example: A user buys in EUR, but your GA4 property uses USD. GA4 converts and reports in USD.
Common Mistakes
Mistake 1: Not Including Item Details
Bad:
gtag('event', 'purchase', {
value: 99.99,
currency: 'USD'
});
Good:
gtag('event', 'purchase', {
value: 99.99,
currency: 'USD',
items: [{
item_id: 'prod_123',
item_name: 'Widget',
price: 99.99,
quantity: 1
}]
});
Without item details, you can't see which products are selling. Include them always.
Mistake 2: Repeating Transaction IDs
If order ID "12345" fires twice, GA4 counts it twice. Always use unique IDs.
Mistake 3: Wrong Currency
Specify currency per-event, not once globally. If you sell in multiple currencies, each event must specify its currency.
Mistake 4: Missing Shipping/Tax in Purchase Value
The value parameter should be the final amount charged, including tax and shipping.
Frequently Asked Questions
Q: What if my ecommerce platform (Shopify, WooCommerce) already has GA4 integration? A: It likely already fires these events. Check your platform's GA4 settings to confirm. If ecommerce data is showing in GA4 reports, you're done.
Q: Can I track refunds?
A: Yes, fire a refund event when a user returns an order. GA4 will adjust revenue calculations automatically.
Q: What if my store sells digital products (apps, ebooks)? A: Use the same events. Item type doesn't matter; the event schema is the same.
Q: Can I import offline sales (in-store) into ecommerce tracking? A: Yes, via the Measurement Protocol or CSV import. See The Complete Guide to Google Analytics 4 (2026).
Q: Why does my revenue in GA4 differ from my Shopify/payment processor? A: Possible causes: timezone differences, refunds, test orders, currency conversion timing. Usually the difference is small. Investigate if large (>5%).
The Bottom Line
GA4 ecommerce tracking is powerful. Implement the core events (view, cart, purchase) and you have visibility into your entire customer journey. Add optional events (shipping, payment info) for even deeper insight.
Start with the basics. Get data flowing. Then refine.
For analyzing ecommerce data, see GA4 Explorations: How to Use the Analysis Hub.
Emily Redmond is a data analyst at Emilytics — the AI analytics agent that watches your GA4, Search Console, and Bing data around the clock so you never miss what matters. 8 years of experience helping founders and growth teams turn data noise into clear decisions. Say hi →