Summer Promo · view_promotion + select_promotion active.

E-Commerce Tracker

The full GA4 e-commerce funnel.

From initial catalog browse to issuing a full refund. Every micro-interaction is tracked.

E-commerce events to capture

view_item_list catalog loaded
select_item product clicked
view_item product page viewed
add_to_cart added to cart
remove_from_cart removed from cart
begin_checkout checkout started
add_shipping_info shipping info added
add_payment_info payment info added
purchase purchase complete
refund refund issued

GA4 e-commerce schema in 60 seconds

Every e-commerce event in GA4 follows the same shape: a top-level event with currency and value, plus an items[] array describing what was acted on. Here's an add_to_cart push as a reference:

dataLayer.push({
  event: 'add_to_cart',
  ecommerce: {
    currency: 'USD',
    value: 49.00,
    items: [{
      item_id: 'SKU_42',
      item_name: 'Halyk Hoodie',
      item_brand: 'Halyk',
      item_category: 'Apparel',
      price: 49.00,
      quantity: 1,
    }]
  }
});

Why this matters:

  • Use the exact event names GA4 expects (view_item, add_to_cart, purchase, etc.). Match the spec and GA4 enriches them automatically — no extra config.
  • items[] carries item_id, item_name, item_brand, item_category, price, quantity. Keep the keys consistent across every event in the funnel.
  • currency is mandatory. value is the sum across items. GA4 derives revenue from these two.
  • Set transaction_id on purchase to deduplicate. Pass it again on refund with the same id to credit the original transaction.
How to capture the funnel (catalog → cart → checkout)
Goal
One reusable tag pattern that handles every funnel step. You'll build six small tags using the same template.
Trigger
Custom Event · event name = view_item_list, select_item, view_item, add_to_cart, begin_checkout, purchase (one trigger per event name).
Tag
GA4 Event tag, event name = the trigger's event name. Add a single Event Parameter named items mapped to the Data Layer Variable ecommerce.items. Add currency and value the same way. Reuse this tag template across all six funnel events.
Verify
Click around the catalog → product → cart → checkout. In GA4 DebugView, you should see the funnel events fire in order with items populated. If items is empty in DebugView, your variable name doesn't match the dataLayer key.
How to capture purchase (the conversion event)
Goal
Mark this as the GA4 conversion. Pass transaction_id, value, currency, tax, shipping, coupon, and the full items[] array.
Trigger
Custom Event · event name = purchase
Tag
GA4 Event tag, event name = purchase. Map ecommerce.transaction_id, ecommerce.tax, ecommerce.shipping, ecommerce.coupon, ecommerce.items, currency, and value. In GA4 Admin → Events, mark purchase as a conversion if it isn't already.
Verify
Complete a checkout with the test coupon. DebugView shows purchase with all parameters populated. Re-run the same checkout with the same transaction_id — GA4 should ignore the duplicate. If you see double revenue, transaction_id isn't being passed correctly.
How to capture refund (and credit the original purchase)
Goal
Match the refund back to its original purchase using the same transaction_id, so GA4 subtracts revenue from the right transaction.
Trigger
Custom Event · event name = refund
Tag
GA4 Event tag, event name = refund. Pass transaction_id (must match the purchase), value, currency, and items[]. For partial refunds, only include the items being refunded with their refunded quantity.
Verify
Issue a refund from the order confirmation screen. DebugView shows refund. In GA4's Monetization report (give it ~24h), you'll see the original revenue net of the refund tied to the same transaction.
GA4 Masterclass
Good Labs Academy
Google Analytics 4 Masterclass
Courses
GTM Server-Side
Good Labs Setup
GTM Server-Side Container
Services
BigQuery
Google Cloud
BigQuery Data Warehouse
Infrastructure
CAPI Integration
Meta
Conversion API Integration
Plugins
Looker Studio Dashboard
Good Labs Design
Custom Looker Studio Dash
Services
Consulting Hour
Good Labs Help
Consulting Hour
Support

Cart

It's empty in here