GTM accepts almost any push. A purchase with the price written as text, the shipping folded into the total and no currency fires the GA4 tag exactly as a correct one does. The difference turns up weeks later, as revenue that does not match the shop’s own numbers.
The rules are short and they are all Google’s. What follows is each one, and the push it applies to.
The events and what each one needs
From Google’s ecommerce reference for Tag Manager. Required means the event is incomplete without it.
| Event | Required |
|---|---|
purchase | transaction_id, items, and value with
currency. Optional: coupon, shipping, tax,
customer_type. |
refund | transaction_id |
add_payment_info | items (optional: payment_type) |
add_shipping_info | items (optional: shipping_tier) |
begin_checkout | items |
add_to_cart, remove_from_cart | items |
add_to_wishlist | items |
view_cart, view_item | items |
select_item, view_item_list | items |
Two more, view_promotion and select_promotion, carry promotion details and are
left out here. Across all of them, one rule holds: if an event sets value, it sets
currency too.
Each item needs one of item_id or item_name (Google recommends both). The rest is
optional: price, quantity, discount, coupon,
item_brand, item_category to item_category5, item_variant,
item_list_id, item_list_name, index, affiliation and
location_id.
A purchase push that passes
dataLayer.push({ ecommerce: null });
dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: 'T-1001',
value: 188.80,
tax: 37.76,
shipping: 4.95,
currency: 'EUR',
items: [
{ item_id: 'SKU-11', item_name: 'Stone pillow', price: 49.90, quantity: 2 },
{ item_id: 'SKU-27', item_name: 'Linen throw', price: 89.00, quantity: 1 }
]
}
});
The numbers agree: 49.90 × 2 plus 89.00 × 1 is 188.80, the value. Tax and shipping sit beside it,
not inside it. Every price and quantity is a number, and both items have an id and a name.
The first line clears the previous ecommerce object. GTM does not read the array of pushes; it keeps a merged
state built from all of them, so a key the new push does not set keeps the value an earlier push gave it. A
coupon from an add_to_cart can end up on the purchase that way.
The dataLayer inspector page covers the difference between the array and
what GTM reads.
In GTM the paths are the ones a Data Layer Variable takes: ecommerce.value,
ecommerce.transaction_id, ecommerce.items. Shops that push their own event names
rather than GA4’s need the mapping first; the guide to
dataLayer dialects has it.
The mistakes to check, one rule each
- value without currency. Google: “currency is required if you set value”, or revenue metrics are not computed accurately. Check every event that carries a value, not only the purchase.
- value that includes shipping or tax. Google defines
valueas the sum ofprice×quantityover the items and says not to include shipping or tax. A total copied from the order confirmation usually has both in it. - value that is not the sum of the items. Each
priceis the unit price after discount, with the discount itself indiscount. Item-level discounts therefore already agree with the total. Google’s page does not say how a coupon on the whole order should show up, so a lowervaluewith an order-level coupon is something to confirm with whoever reads the reports, not an error by itself. A highervaluethan the items usually means shipping or tax went in. - Items with neither item_id nor item_name. One of the two is required on every item. This is the field a template loop most often leaves empty when the product object has a different key.
- price as text with a currency sign.
"549,75 TL"or"€49.90". Tag Master’s rule for this, listed on the GA4 parameters page, reads such a price as zero and asks for a plain number: 549.75, no symbol, dot as the decimal separator. The same goes forvalue. - quantity left out. It defaults to 1. Fine for a single item; a cart line of three without
it is counted as one, and the items no longer add up to
value. - More than 200 items. Google: “The items array can include up to 200 elements.” A large
basket or a full category list in
view_item_listis where this happens. - More than 27 custom item parameters. Up to 27 per item, on top of the prescribed ones. Product feeds copied wholesale into the item object pass this quickly.
- purchase without transaction_id. It is required, and
refundneeds it too, to find the purchase it reverses. - The same purchase sent twice. A reloaded confirmation page sends an identical purchase,
transaction_idincluded. The duplicate events guide separates that case from two tags sending one purchase each.
A correct push is half of it. The tag that reads it can still send something else: a variable pointed at
ecommerce.items.0.price instead of ecommerce.value, or no currency
mapped at all. Check the push, then check the request it produced.
Checking it in Tag Master
The extension’s Events panel records every push in order, including the ones made while the page loads, checks each one against the GA4 ecommerce schema and shows a score with its recommendations. Each push is flattened into the paths a GTM variable reads, and listed beside the requests it set off, with what each request left out compared with the push.
Without the extension, the free tools cover the same ground one request at a time. The tracking request decoder takes the GA4 hit and runs the extension’s rules on it: currency codes, transaction IDs on purchases, items with no id or name, prices that are not numbers, and a value that does not match its items. For purchases sent from your server, the Measurement Protocol validator checks the JSON body before it goes to GA4.
Questions
Should the GA4 purchase value include shipping and tax?
No. Google defines value as the sum of price × quantity for all items and says not to include shipping or tax. Those go in their own shipping and tax parameters on the purchase.
What happens if I send value without currency?
Google’s reference says currency is required if you set value, so that revenue metrics can be computed accurately. Send the three-letter code, such as EUR, on every event that carries a value.
Does every item need an item_id?
Each item needs at least one of item_id or item_name, and Google recommends sending both. An item with neither is the one to fix first.
How many items can one GA4 ecommerce event carry?
Up to 200 elements in the items array, and up to 27 custom parameters per item on top of the ones Google prescribes.
Why is my GA4 purchase counted twice?
Most often the confirmation page was loaded twice: a reload, a back-navigation, or a checkout that renders again. Send transaction_id on every purchase, then read the two hits side by side to tell a reload from two tags.
The rest of this group: Shops and their data layers
More in Shops and their data layers
Try it on your own site
Tag Master is free, needs no account, and collects no data.
Add to Chrome, it’s free