Sub topic 4
Item Parameters: IDs, Names, Prices, Quantities, and Categories
This chapter assumes you know what the items array is (a list of product objects attached to an e-commerce event) and how GA4 events carry parameters. It covers the fields inside each item object, the rules GA4 applies to them, and the mistakes that most often corrupt item reports.
What item parameters are
Every object in the items array describes one product line. The keys of that object are item parameters. They are separate from event-level parameters such as currency, value, and transaction_id. GA4 maps each item parameter to an item-scoped dimension or metric in reports, for example item_name to "Item name" and price and quantity to the inputs of "Item revenue".
The most common standard item parameters are listed below.
| Parameter | Type | Purpose |
|---|---|---|
| `item_id` | string | Your product identifier, such as a SKU |
| `item_name` | string | Human-readable product name |
| `item_brand` | string | Brand or manufacturer |
| `item_category` to `item_category5` | string | Up to five levels of category hierarchy |
| `item_variant` | string | Variant such as color or size |
| `price` | number | Unit price of one item |
| `quantity` | integer | Number of units in this line |
| `discount` | number | Per-unit discount amount |
| `coupon` | string | Coupon applied to this item |
| `index` | integer | Position in a list, starting at 0 |
| `item_list_id`, `item_list_name` | string | The list the item was shown in |
| `affiliation` | string | Store or supplier |
| `location_id` | string | Physical location or place ID |
Required fields
Every item needs at least one of item_id or item_name. In practice, send both. item_id is stable and unique, so it is the right key for joining GA4 data to your catalog. item_name is what people read in reports. If a product is renamed, reports split it into two rows when you group by name, but grouping by ID stays consistent.
For events that carry money, such as add_to_cart and purchase, also send price and quantity. If you omit quantity, GA4 treats it as 1 for item revenue purposes.
Price is per unit
The single most common error is sending a line total as price. GA4 multiplies price by quantity to compute item revenue. Sending the line total therefore inflates revenue by the quantity.
// Two pairs of shoes at 24.99 each.
const item = {
item_id: 'SKU_1001',
item_name: 'Trail Running Shoe',
price: 24.99, // unit price, not 49.98
quantity: 2
};
// The event-level value is the sum of price * quantity.
const value = item.price * item.quantity; // 49.98Send price as a number, not a string such as "$24.99". Do not include currency symbols or thousands separators. Use a period as the decimal separator. The currency itself belongs in the event-level currency parameter, not in the item.
Discounts
discount is the discount applied to one unit, not the whole line. If a shoe has a list price of 29.99 and sells for 24.99, you have two valid choices, and you must pick one and keep it consistent:
- Send
price: 24.99(the price actually charged) and optionallydiscount: 5.00for reporting. - Send
price: 29.99anddiscount: 5.00, and make sure your eventvaluereflects the discounted total.
GA4's item revenue is based on price times quantity. For purchase events, the common convention is to send the price after the item discount. Whichever you choose, check that the sum of price * quantity across items matches the event value.
gtag('event', 'add_to_cart', {
currency: 'USD',
value: 49.98,
items: [
{
item_id: 'SKU_1001',
item_name: 'Trail Running Shoe',
item_brand: 'Acme',
item_category: 'Shoes',
item_variant: 'blue',
price: 24.99,
quantity: 2,
discount: 5.00,
coupon: 'SUMMER_SALE'
}
]
});Category hierarchy
Categories are a ladder. item_category is the broadest level and item_category2 through item_category5 narrow it down. Fill them in order and do not skip levels.
const categorizedItem = {
item_id: 'SKU_1001',
item_name: 'Trail Running Shoe',
item_category: 'Apparel',
item_category2: 'Mens',
item_category3: 'Shoes',
item_category4: 'Running',
item_category5: 'Trail'
};Use consistent capitalization and spelling. "Shoes" and "shoes" are different values in reports. Pick one convention in your data layer and enforce it there, because GA4 will not merge them later.
Position and list parameters
index records where an item appeared in a list. It is zero-based in the GA4 documentation examples, so the first item is 0. item_list_id and item_list_name record which list showed the item, such as "Search results" or "Related products". Send these on view_item_list and select_item. Many sites also keep them in memory and attach them to later events such as add_to_cart, so reports can attribute a cart add to a list. GA4 does not do this carry-over for you.
Consistency across the funnel
An item should look the same at every step. The same product should carry the same item_id, item_name, and item_variant in view_item, add_to_cart, begin_checkout, and purchase. If the cart page sends item_name: 'Trail Running Shoe - Blue' while the product page sends 'Trail Running Shoe', funnel reports that group by name show two separate products and the drop-off between steps looks wrong.
Limits and edge cases
- GA4 accepts up to 200 items per event, and the whole event payload has a size limit. Large carts with many fields can hit it, so send only the parameters you use.
- Item parameter values are limited in length. Standard item parameter values are truncated at 100 characters, so avoid long descriptive names.
- Custom item parameters (for example
item_material) are collected, but they appear in reports only after you register them as item-scoped custom dimensions. Registration is not retroactive. - Missing or empty values are not an error, but they show up as "(not set)" in reports. A blank
item_categoryproduces a large "(not set)" row. - Negative
quantityorpricevalues are not valid for purchases. Use therefundevent to reverse revenue instead.
Common errors
- Sending
priceas the line total instead of the unit price. - Sending
priceorquantityas strings with symbols. - Omitting
item_id, leaving only a name that changes over time. - Using different
item_namevalues for the same product at different steps. - Skipping category levels, such as filling
item_category3but notitem_category2. - Sending event
valuethat does not equal the sum ofprice * quantity.
A quick check in code catches most of these before the event is sent.
function validateItems(items, value) {
const errors = [];
let sum = 0;
items.forEach((item, i) => {
if (!item.item_id && !item.item_name) {
errors.push(`item ${i}: needs item_id or item_name`);
}
if (typeof item.price !== 'number') {
errors.push(`item ${i}: price must be a number`);
}
const qty = item.quantity === undefined ? 1 : item.quantity;
if (!Number.isInteger(qty) || qty < 1) {
errors.push(`item ${i}: quantity must be a positive integer`);
}
sum += (item.price || 0) * qty;
});
if (Math.abs(sum - value) > 0.005) {
errors.push(`value ${value} does not match items total ${sum.toFixed(2)}`);
}
return errors;
}
console.log(validateItems(
[{ item_id: 'SKU_1001', price: 24.99, quantity: 2 }],
49.98
)); // []Exercise
A cart contains 3 units of a product with a unit price of 10.00. A developer sends price: 30.00, quantity: 3 and value: 90.00. What does GA4 report as item revenue, and what should be sent instead?
Show answer
GA4 multiplies price by quantity, so it reports 90.00 of item revenue instead of 30.00. The developer should send price: 10.00, quantity: 3 with value: 30.00.
Exercise
Why should you send both item_id and item_name, and which one should you use to join GA4 data to your product catalog?
Show answer
item_name is readable but can change or differ between pages, while item_id is stable and unique. Send both, and join to the catalog on item_id.