Remove from cart, empty cart and add list to cart

  • 2 May 2023
  • 1 reply

Badge +1

I have have added the “add to cart” event, but is left with managing the following scenarios and can’t seem to find any documentation on these:

  • Customer removes item from cart
  • Customer empties cart
  • Customer adds a list of items to cart

Best answer by Brian Turcotte 2 May 2023, 17:08

View original

1 reply

Userlevel 7
Badge +36

Hi @nicolai!


The first two events you mentioned are actually not native to Klaviyo, so there is no supported way of tracking when a user empties or removes items from their cart. However, you may be able to achieve a suitable solution by working with a developer to track a custom metric for this using our track API:


For example, perhaps you could add a listener to the “remove from cart” button/link on your site, that triggers a custom “removed from cart” event, like in this example for a “Like” button from our Developer Portal:

You can also track events when a customer clicks a custom button you have defined. In this example, an event listener tracks when a customer clicks a "Like" button on an item, creating an Added Like custom event. We can then set up a custom flow trigger to send emails to customers about items they've "liked" or view reports on "liked" items.


<script type="text/javascript"> document.getElementById("Like").addEventListener('click',function (){ klaviyo.push(['track', 'Added Like', item]); }); </script>


However, the feasibility of this solution will depend largely on the structure of your site and the extent of your development capabilities.


Regarding your final point about an event when a “Customer adds a list of items to cart”, I actually addressed this in a different thread here:


To summarize what I wrote there, an Added to Cart event is fired whenever a customer adds a single product to the cart, and will be repeated when any other individual products are added. Therefore, this event can’t be used to track all of the products in a cart. The Started Checkout event, however, is fired when a user enters their email at the start of checkout, and it passes event data for all products that are present in the cart at that time. So if you’re looking for an event that captures the entire list of products in a customer’s cart, it would be Started Checkout. Here’s our Help Center article on this event:


If you’re looking for an event that captures the customer’s cart at some time before they start checking out, it would require another customization.


I hope this helps get you started, and thanks for using the Community!

- Brian