Tag add_to_cart properly

add_to_cartselect_item

The merge trap

The GTM dataLayer does not replace objects: it deep-merges them. An add_to_cart pushed after a view_item_list therefore inherits the list's items unless something clears them in between.

The fix is one line, and it must precede every ecommerce event:

dataLayer.push({ ecommerce: null });
dataLayer.push({ event: "add_to_cart", ecommerce: { /* … */ } });

That is what pushEcommerce does on this site, and it is its only reason to exist.

Checking it

On the catalogue, click "Add to cart" on any product. In preview, the add_to_cart event must carry one item, and its quantity must be 1.

Start again from a product page with the quantity set to 3. The pushed quantity must be 3, and value 36 — not 12.

select_item is not a click on "Add"

On this site, select_item only fires on a card's link, never on its add button. The distinction is not cosmetic: counting direct adds as selections inflates the click-through rate of lists, and the report then shows selections that no product view follows — an anomaly people spend hours chasing on the attribution side when it lives on the tagging side.