Consecutive `remove_from_cart` events are not tracked
tomalec opened this issue · 0 comments
tomalec commented
Describe the bug:
When removing items from the cart, only the first removal is tracked. All the following are not. Most probably, because the cart is re-rendered by WC, and our plugin binds events only once on the first load.
Steps to reproduce:
- Add 3 items to the cart
- Go to the cart page
- open network pannel watch for
google-analytics.com/g/collect
withen=remove_from_cart
- (optional) open sources dev tab, put a breakpoint on
gtag('event', 'remove_from_cart', {
line - Remove the first item from the cart
- 🟢 Request to
collect
is sent - Remove another item from the cart
- 🔴 No request with
en=remove_from_cart
is sent
Expected behavior:
en=remove_from_cart
should be send for each consecutive removal.
Actual behavior:
No request with en=remove_from_cart
is sent for 2+ removed items
Additional details:
This was found during WC 7.9 testing.
But it is probably an older issue and a reason of confusion in testing instruction
After removing an item from the cart, confirm the request to
google-analytics.com/g/collect
withen=remove_from_cart
NOTENot working as of 2022-04-27Confirmed working as of 2022-08-29.