Home › Blog › E-commerce tracking in GA4: how to measure your webshop
Blog · Tracking & analytics

E-commerce tracking in GA4: how to measure your webshop

Which e-commerce events GA4 expects, which parameters are required, what to put in value and how to handle duplicate purchases and refunds correctly.

GA4 doesn't measure e-commerce by itself: your webshop has to pass on every step as an event [1]. At a minimum, measure purchase, with a unique transaction ID, an items list, a value as a number and the currency. Send refunds with refund, add payment pages to your unwanted referrals and compare your GA4 revenue with your webshop's every month.

Whether you set it up yourself, ask your web developer or bring in a Google Analytics agency: the choices are the same. The most important one is what you put in value, because GA4, Google Ads and your own reporting must use the same number.

Which events do you need?

Start with purchase, then add the steps leading up to it. Use the names Google recommends: GA4 automatically fills reports with them, such as Ecommerce purchases [1].

The main e-commerce events in GA4 (sources [1], [2])
EventWhen it fires
view_itemA visitor views a product page
add_to_cartA product goes into the cart
begin_checkoutThe checkout starts
purchaseThe order is placed
refundAn order is fully or partially refunded

With the first four you see where visitors drop off. Google has more, including events for product lists, shipping and payment information and internal promotions [2]. If you use Shopify, the Shopify pixel measures some events automatically: check which ones, so they don't fire twice alongside your own tags [1].

Which parameters belong to a purchase?

For purchase, two parameters are required, and the rest determines whether your revenue figures are usable [2].

Parameters of the purchase event (source [2])
ParameterRequired?What goes in it
transaction_idYesA unique ID per order, such as your order number, without data that points to a customer [3]
itemsYesThe items purchased, each with at least an item_id or an item_name
valueYes, with a caveatThe sum of price times quantity of all items, as a number
currencyYes, as soon as you send valueThe three-letter currency code, EUR for Belgian webshops
tax, shippingNoTax and shipping costs, as separate numbers

A number means without a currency sign: 72.05, not "€ 72,05" [4]. Optional parameters include coupon and customer_type (new or returning), for which Google recommends a 540-day window [2].

What do you put in value?

Google recommends value excluding shipping and tax; you send those separately in shipping and tax [2]. For a Belgian webshop that shows prices including VAT, that is a deliberate choice.

Both can work, as long as you use one definition. If you switch from month to month, or Google Ads uses a different value than GA4, your bid strategy steers on a different number from the one you report on.

How to send a purchase

With Google Tag Manager, your webshop pushes the data to the data layer, and a GA4 tag passes it on. Clear the previous ecommerce object first, so data from an earlier step doesn't carry over [5]:

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: 'purchase',
  ecommerce: {
    transaction_id: 'BE-10482',
    value: 59.50,
    tax: 12.50,
    shipping: 4.95,
    currency: 'EUR',
    items: [{
      item_id: 'SKU-231',
      item_name: 'Tuinhandschoenen leder',
      price: 29.75,
      quantity: 2
    }]
  }
});

Here the prices exclude VAT: value is 2 x 29.75 = €59.50. In the GA4 event tag, tick Send Ecommerce data under More Settings › Ecommerce, and a Custom Event trigger on purchase fires the tag [5].

Ask your web developer or platform to make sure the events follow Google's names exactly, and that purchase only fires once the order has been placed, not on the click on "Place order". Test every change in DebugView: in the standard reports, e-commerce data can take up to 24 hours to appear [1].

Duplicate purchases and refunds

The transaction ID protects you against duplicate purchases, for example when a customer reloads the confirmation page: GA4 deduplicates purchases with the same ID, but only for web streams [3]. Never send an empty or fixed ID, because GA4 will then filter out real orders [3]. How to track down duplicate or unknown transactions is covered in Fixing (not set), spam and duplicate purchases in GA4.

You report a refund with refund, with the same transaction ID and the refunded items in the items list [1], [5]. Purchase revenue deducts refunds, Gross purchase revenue does not [6]. Because a refund usually happens in the back office, ask your web developer explicitly how the refund event is sent.

Payment pages as unwanted referrals

If a customer pays on the page of a payment provider or their bank, GA4 can see their return as a new visit from that domain. The payment provider then gets the sale, not the campaign that brought the customer; Google uses this example itself [7]. Add those domains to the unwanted referrals in your web stream's tag settings, up to 50 per stream [7].

You can see which domains they are in your Traffic acquisition report. To find them, test a payment with every payment method you offer.

Checking revenue and sending it to Google Ads

GA4 and your webshop never show exactly the same figure. The question is whether the difference is explainable and stable.

Why GA4 revenue and webshop revenue differ
CauseWhat happensWhat you do
ConsentVisitors who refuse are missing from GA4 or only modelledAccept it as a permanent difference
Definition of valueGA4 without VAT, your accounts with it, or the other way roundTake the same number from your webshop
RefundsWithout a refund event, the full revenue remainsSet up refund, or compare with Gross purchase revenue [6]
Unpaid orderspurchase counts a payment by bank transfer before it has been paidCompare with orders placed
TimingGA4 follows your property's time zone, and data can arrive up to 24 hours later [1], [8]Set the property to Brussels, don't compare on the same day

A difference that stays the same size month after month is usually consent. A sudden jump after an update to your webshop, theme or banner points to an error.

To steer campaigns on revenue, turn purchase into a conversion in Google Ads; conversions from GA4 are set to secondary by default [9]. How to make that choice is explained in GA4 key events and conversions: the difference explained. For Shopping campaigns that value has to be right: see How to set up a Google Shopping campaign: step by step for online stores.

Not sure whether your e-commerce measurement adds up? The free tracking audit checks which events fire, which parameters they send and whether purchases count once.

Frequently asked questions

Which e-commerce events do I need in GA4?

At least purchase, because that measures your revenue. Google also recommends a set of events that follow the path from product list to purchase, such as view_item, add_to_cart and begin_checkout, plus refund for refunds. With those events you see where visitors drop off.

Which parameters are required for a purchase?

For the purchase event, Google requires a unique transaction_id and an items list in which each item has an item_id or item_name. Without value and currency you get no usable revenue figures, and if you send value, you must also send currency. Tax and shipping costs go separately in tax and shipping.

Should the value in GA4 include VAT and shipping?

Google recommends setting value to the sum of price times quantity of all items, excluding shipping and tax. You send those separately in shipping and tax. More important than the choice itself: use the same definition in GA4, in Google Ads and in your own reporting.

Why does the revenue in GA4 differ from the revenue in my webshop?

Because GA4 only sees what the browser sends. Visitors without consent are missing or modelled, and refunds only count with a refund event. The definition of value, duplicate purchases and unpaid orders also play a part. Your webshop remains the source of truth.

How do I handle refunds in GA4?

With the refund event, using the same transaction_id as the original purchase. Google recommends including the refunded items in the items list, with item_id and quantity, for both full and partial refunds. The Purchase revenue metric deducts refunds, Gross purchase revenue does not.

Sources

  1. [GA4] Set up ecommerce events — Analytics Help, accessed 27 Sep 2026
  2. Recommended events (developer reference) — Google for Developers, 16 Sep 2026, accessed 27 Sep 2026
  3. Minimize duplicate key events with transaction IDs — Analytics Help, accessed 27 Sep 2026
  4. Fix missing revenue data — Analytics Help, accessed 27 Sep 2026
  5. Measure ecommerce — Google for Developers, 19 Aug 2026, accessed 27 Sep 2026
  6. Analytics dimensions and metrics — Analytics Help, accessed 27 Sep 2026
  7. Identify unwanted referrals — Analytics Help, accessed 27 Sep 2026
  8. Set up Analytics for a website and/or app — Analytics Help, accessed 27 Sep 2026
  9. Create Google Ads conversions based on Google Analytics key events — Analytics Help, accessed 27 Sep 2026
·

Further reading

Blog · Tracking & analytics

Are your numbers right?