Most GA4 ecommerce tracking looks fine on the surface, until you dig into the dataLayer. Our tool parses and inspects your ecommerce events live, flagging missing fields, incorrect types, and broken schemas before they corrupt your reports.
Use this tool to explore example dataLayer.push()
formats for common GA4 ecommerce events like view_item
, add_to_cart
, and purchase
. You can select a schema from the dropdown to preview its recommended structure and field comments.
The table below lists all supported GA4 item parameters. You can toggle it open to explore what each field means, what data type is expected, and whether itβs required or optional for proper ecommerce tracking.
Parameter | Description | Type | Example | Notes |
---|---|---|---|---|
item_id | Unique identifier for the item | String | SKU_12345 | Required |
item_name | Name of the item | String | Blue T-Shirt | Required |
affiliation | Store or partner name | String | Online Store | Optional |
coupon | Item-level coupon code | String | SUMMER_SALE | Optional |
currency | Currency in ISO 4217 | String | USD | Typically set at event level |
discount | Discount on item | Number | 5.00 | Optional |
index | Position in list | Number | 1 | Optional |
item_brand | Brand name | String | BrandX | Optional |
item_category | Primary category | String | Apparel | Optional |
item_category2 | Secondary category | String | Shirts | Optional |
item_category3 | Third-level category | String | Menβs | Optional |
item_category4 | Fourth-level category | String | Casual | Optional |
item_category5 | Fifth-level category | String | Short-Sleeve | Optional |
item_list_id | ID of the product list | String | category_page_1 | Optional |
item_list_name | Name of the product list | String | Category Page | Optional |
item_variant | Variant (e.g., size, colour) | String | Blue | Optional |
location_id | Physical/virtual location ID | String | store_001 | Optional |
price | Unit price | Number | 29.99 | Required for purchase/cart events |
quantity | Number of units | Number | 2 | Required for purchase/cart events |
To extract ecommerce tracking data directly from your site, open your browser's developer console (usually by pressing F12 or Right Click β Inspect β Console) and paste the following code snippet. This will return any ecommerce-related dataLayer.push()
entries from the current page, which you can then copy and paste into the validator below.
If you are having troube, try typing 'allow pasting' into the console first.
dataLayer.forEach((entry, i) => {
let ecommerceEntry = null;
// Case 1: Plain object with ecommerce
if (entry && typeof entry === 'object' && entry.ecommerce) {
ecommerceEntry = entry;
}
// Case 2: Arguments-like object with ecommerce inside the 3rd param
else if (
Object.prototype.toString.call(entry) === '[object Arguments]' &&
typeof entry[2] === 'object' &&
entry[2] !== null &&
entry[2].items // or entry[2].ecommerce if it's standard ecommerce structure
) {
ecommerceEntry = {
event: entry[1] || 'unknown_event',
ecommerce: {
...entry[2]
}
};
}
if (ecommerceEntry) {
const formatted = JSON.stringify(ecommerceEntry, null, 2);
console.log(`// Ecommerce Push ${i + 1}\ndataLayer.push(${formatted});\n`);
}
});
Paste your dataLayer.push()
object into the box below. When you click Validate, weβll check the structure and value types against GA4 best practices to flag any issues, missing fields, or type mismatches. This helps ensure your dataLayer is clean, complete, and ready for accurate tracking.
Enter your email to access the tool and get early access to future features and insights. We respect your privacy β read our Privacy Policy.
Net Impression is a UK-based analytics consultancy, specialising in advanced GA4, GTM, BigQuery, and conversion rate optimisation for agencies and growth teams.