GA4 add_to_cart event not working: why the report is empty
Guide/ 11 min read
Why GA4 says nobody adds to cart while orders keep coming, and the exact add_to_cart code for gtag and dataLayer, tested and checked in DebugView.
- Analytics
- JavaScript
In this article (8)
When the GA4 add_to_cart event is not working, the report says nobody adds to cart while orders keep coming in. The cause is almost always on your side: a misspelt event name, a missing currency, value or items, or a tag that never fires. Send the exact name with its parameters and confirm it in DebugView first.
This post covers the exact ecommerce event names, what each parameter needs, working code for both gtag.js and the dataLayer, and the order to validate it in. I ran every snippet in Chromium against a local dataLayer with all Google traffic blocked, so what you see is exactly what ends up on the page. If shoppers drop off before they ever reach the cart, start with the slow hero image; the next step of the funnel is the mobile checkout form.
Why the add_to_cart report is empty
An add_to_cart that never shows up is rarely a GA4 bug. It is one of these five things, and they are worth ruling out in this order:
- The name is not exactly
add_to_cart. Per the event naming rules, event names are case sensitive:my_eventandMy_Eventare two different events.addToCartoradd_to_cardthrow no error; they arrive as custom events that the ecommerce reports ignore. - Parameters are missing. The recommended events reference marks
itemsas required on add_to_cart, andcurrencyas required as soon as you sendvalue. - The tag never fires. In Tag Manager, the trigger waits for one specific event name. If your code pushes a different one, nothing happens and nothing complains.
- You are looking too early. Google's data freshness page says processing can take 24 to 48 hours. Realtime takes a few minutes and DebugView takes seconds.
- Consent hides it. The DebugView help notes that events will not show if privacy controls are set, or if consent mode is active without Analytics cookie consent. Accept the cookies while you test.
Scroll the figure sideways to see all of it
The first three are visible in the browser before anything reaches GA4. That is why the validation below starts in the console, not in the reports.
Exact GA4 ecommerce event names
The GA4 ecommerce guide groups the events by the step of the purchase. These are the main ones, with what the reference marks as required:
| Event | When to send it | Required |
|---|---|---|
view_item_list | A list of products is shown, such as a collection | items |
select_item | A product is picked from that list | items |
view_item | A product page is viewed | items; currency if you send value |
add_to_cart | A product is added to the cart | items; currency if you send value |
remove_from_cart | A product is removed from the cart | items; currency if you send value |
view_cart | The cart is viewed | items; currency if you send value |
begin_checkout | Checkout starts | items; currency if you send value |
add_shipping_info | Shipping details are submitted | items; currency if you send value |
add_payment_info | Payment details are submitted | items; currency if you send value |
purchase | The order is completed | transaction_id, items; currency if you send value |
refund | An order is refunded | transaction_id; currency if you send value |
Every name is lowercase with underscores. Copy them from this table instead of typing them from memory and the most common cause is gone.
Parameters: currency, value and items
The three add_to_cart parameters have specific rules in the reference:
currency: a three-letter ISO 4217 code such as"USD". If you sendvalue, it is required for revenue to be computed correctly."$"or"dollars"will not do.value: a number, not a string. Google asks for the sum ofprice × quantityacross everything initems, without shipping or tax.items: an array with one object per product. Each object needsitem_idoritem_name, and the guide recommends sending both.priceis the unit price, and if you leave outquantity, GA4 counts 1.
Scroll the figure sideways to see all of it
There are more item parameters (item_brand, item_category, item_variant, coupon, discount and so on). They are optional: add them when you have the data, but they are never the reason a report is empty.
add_to_cart example with gtag and with dataLayer
Use one of the two for each event, depending on how the tag is installed. If your site loads gtag.js directly, use the first; if it runs Google Tag Manager, use the second. Products and prices are illustrative.
With gtag.js
gtag("event", "add_to_cart", {
currency: "USD",
value: 48,
items: [
{
item_id: "MUG-001",
item_name: "Ceramic mug",
price: 24,
quantity: 2,
},
],
});
gtag("event", "add_to_cart", {…}): the first argument says this is an event; the second is its exact name.currency: "USD": the currency sits at event level, not inside each item.value: 48: two mugs at 24, as a number. No quotes, no dollar sign, no shipping.items: [ … ]: one object per product, even when only one is added.item_idanditem_name: the SKU and the name you want in the item reports.priceandquantity: unit price and count. Their product must equalvalue.
With the dataLayer and Google Tag Manager
window.dataLayer = window.dataLayer || [];
function trackAddToCart(product, quantity) {
window.dataLayer.push({ ecommerce: null }); // clear the previous ecommerce object
window.dataLayer.push({
event: "add_to_cart",
ecommerce: {
currency: "USD",
value: product.price * quantity,
items: [
{
item_id: product.sku,
item_name: product.name,
price: product.price,
quantity: quantity,
},
],
},
});
}
// Call it once your cart confirms the item was added, not on the click:
trackAddToCart({ sku: "MUG-001", name: "Ceramic mug", price: 24 }, 2);
window.dataLayer = window.dataLayer || [];: creates the data layer if it does not exist yet, without wiping what is already there. The data layer docs say to instantiate it this way once per page and never reassign it.dataLayer.push({ ecommerce: null }): Google puts this before every ecommerce event in its Tag Manager examples to clear the previousecommerceobject. Without it, data from an earlier event on the same page can bleed into this one.event: "add_to_cart": the name the Tag Manager trigger listens for. It has to match character for character.ecommerce: { … }: in the dataLayer the parameters live insideecommerce; with gtag they sit at the top level.value: product.price * quantity: computed from the same data asitems, so the two can never disagree.- The last line is the call. Put it where your cart confirms the product went in (your API's or theme's response), not on the button click: a failed click is not an added product.
In Tag Manager, the tag that picks this up is a "Google Analytics: GA4 Event" tag with the event name add_to_cart. Under More Settings › Ecommerce, tick Send Ecommerce data and pick Data Layer as the source. The trigger is a Custom Event named add_to_cart. That is how the Tag Manager version of the ecommerce guide sets it up.
In my test, with the real gtag.js and Tag Manager loaders on the page but their requests blocked, the dataLayer ended with exactly these objects: one { ecommerce: null } and the event with value: 48 and a single item. No request reached Google.
How to validate add_to_cart in DebugView
Validate from the inside out: first what is on your page, then what GA4 receives, and the reports last.
Scroll the figure sideways to see all of it
1. In the browser console
Add a product to the cart, open the developer tools and paste this into the console:
dataLayer.filter((e) => e.event === "add_to_cart" || e[1] === "add_to_cart");
e.event === "add_to_cart"finds dataLayer pushes.e[1] === "add_to_cart"finds gtag calls, which are stored as an arguments list.- An empty array means the problem is on your site: the code never ran or it uses another name. GA4 cannot show something that never left the page.
2. In Tag Assistant or Tag Manager preview
Open your site through tagassistant.google.com or Tag Manager's preview mode. It shows whether the GA4 tag fired on the event, and with which parameters. If the push is in the console but the tag does not fire, check the trigger's event name.
3. In DebugView
Per the DebugView help page, Tag Assistant and Tag Manager preview turn on debug mode for your own device. With gtag you can also turn it on for the whole site:
gtag("config", "G-XXXXXXXXXX", { debug_mode: true });
G-XXXXXXXXXXis your web stream's measurement ID.debug_mode: trueonconfigflags every event on that page; to flag a single one, put the parameter on thateventcall instead.- To turn it off, remove the parameter. Setting it to
falsedoes not disable it.
Then go to Admin › Data display › DebugView. The seconds stream shows what arrived in the last minute. Click add_to_cart and check it carries currency, value and items with your products. If you tested on several devices, pick yours in the device selector.
4. In the reports
Once DebugView looks right, the Realtime report should show the event within minutes. Standard reports can take 24 to 48 hours. If it is still empty after two days and DebugView was fine, check consent and your property's data filters.
Common mistakes
- Typing the name from memory.
addToCart,Add_To_Cartandadd_to_cardall reach GA4 without an error, as custom events. Copy the name from the reference. - Sending
valueas a string."$48.00"is a string. Send48, and put the currency incurrency. - Sending
valuewithoutcurrency. The reference requires it whenevervalueis set. - An empty
items. It is required, and every item needsitem_idoritem_name. - Skipping
{ ecommerce: null }. Without it, ecommerce events on the same page can mix in Tag Manager. - Firing on the click. If the product does not go in (out of stock, network error), you count an add_to_cart that never happened.
- Two implementations at once. According to Shopify's help center, GA4 is connected through the Google & YouTube sales channel and some ecommerce events are tracked automatically. If you paste your own code on top, check in DebugView that one click does not send two add_to_cart events.
- Leaving
debug_mode: falseto switch it off. It stays on; remove the parameter instead.
Frequently asked questions
How long does add_to_cart take to show in GA4?
Seconds in DebugView and a few minutes in Realtime. For standard reports, Google says processing can take 24 to 48 hours, so do not judge a fix in those reports on the day you ship it.
Can I use my own event name?
You can, and GA4 stores it as a custom event. But the ecommerce reports are built on the recommended names. For the cart, the name is add_to_cart and there is no alternative.
Should I use gtag or the dataLayer?
It depends on how the tag is loaded. With gtag.js on the page, call gtag("event", …). With Google Tag Manager, push to the dataLayer and let a GA4 tag send it. Do not send the same event both ways, or it gets counted twice.
Does my Shopify store need this code?
If you connected GA4 through the Google & YouTube channel, Shopify already tracks some ecommerce events. Before writing anything, add a product with DebugView open: if add_to_cart already arrives correctly, do not duplicate it. This code is for custom storefronts, themes with a custom cart, or events the channel does not send.
Checklist
- The name is exactly
add_to_cart, copied from the reference. currencyis a three-letter code and is present whenevervalueis.valueis a number equal to the sum ofprice × quantity, without shipping or tax.itemshas one object per product, each withitem_idoritem_name.- With the dataLayer, every event is preceded by
{ ecommerce: null }. - The event fires when the cart confirms, not on the click.
- The console shows the push and Tag Assistant shows the tag firing.
- DebugView shows add_to_cart with its three parameters.
- No two implementations send the same event.
Measuring the cart correctly is step one; step two is giving shoppers fewer reasons to leave it. If the button is slow to respond, see the slow add-to-cart button; if the page is slow to appear, the hero image that holds back LCP; and if they leave while paying on a phone, the attributes that fix a mobile checkout form. With data you can trust, CRO stops being guesswork.
Saw this on Instagram? Comment GA4 on the Reel and I'll send you the guide.
Written by

Published October 30, 2026 · updated November 1, 2026