Abandoned Carts Email -- How to prevent sending the email if the Cart is deleted?
I am transitioning from the Shopify integration to the APIs and I will be synching my Carts in the Checkout Started events.
When creating flows to send Abandoned Cart emails, I add a link to the cart so the user can complete their purchase. In the backend, I delete carts after a certain amount time to clean up the database.
Is there a way for me to stop sending emails that point to deleted carts?
Seems like there is no record of shopping carts in Klaviyo.
Thanks!
Page 1 / 1
Hi Chris, if you’re clearing carts on your end, could you send a custom event to the Klaviyo profile — say, “Cart Deleted” — and then in your abandoned cart flow, check whether the profile has had this event since starting the flow? This way, you could stop the flow from triggering if this custom event came in after the Started Checkout event (or whatever event you’re using for the abandoned cart flow).
@saulblum thanks for responding!
Considering that a profile might be able to have multiple carts, I will have the send an custom Cart Deleted event with the id of the cart right? Would that allow me to have 1 generic event with filters for the Abandoned Cart email flow?
Multiple carts meaning, say, across multiple browsers?
Regarding passing in the cart ID with this new event, is there some property of the Started Checkout event that would have this same ID? Though, even if there were, we can’t do a flow filter with a dynamic comparison value (e.g. Started Checkout cart ID == Cart Deleted cart ID.
If the Started Checkout event does have a cart ID, one approach could be a profile property that’s an array of currently valid (non-deleted) cart IDs, and in the email itself, there is a way to dynamically cancel an email by doing a catalog lookup on a non-existent product. In the email template, you could check whether the cart ID of Started Checkout event (assuming there’s such a property) is contained in that profile property list (which you would update every time there’s a Started Checkout event and every time you delete a cart), and if not, we can use tagging to cancel the email from being sent.
While there is a solution to this, I'm curious as to WHY you have this problem. Best practice for abandoned cart emails are 1-2 days MAX. If you are emailing customers weeks afterwards I think you have a scheduling problem not a technical problem. Keeping your customers carts makes sense for 30-60 days what have you, but you should be sending the abandoned cart email WAY earlier. Once the abandoned cart email is sent they’ve completed the flow so customer won’t receive any more emails unless you have specified that they do.
As for the technical side, one big adjustment our team needed to make was conceptually understanding how Klaviyo worked. We came from a solution that was very structured - carts, orders etc. Klaviyo has none of this structure. You create a cart by creating an event that you’ve identified as a cart event. You then can submit whatever data you need inside that event. So the sky is the limit for whatever you want to do there.
@saulblum thank you for getting back to me!
I like your suggestion. Although is a bit hacky it seems like there are not that many options at the moment to handle this in Klaviyo. Thank you, I will consider it!
@cdetdi I see your point, and that makes total sense about sending emails before carts are deleted however I just wanted to prevent the bad experience. Now take a look at this other scenario.
What if the user starts checkout, the event is emitted, but then the user goes back for whatever reason and removes/adds an item to then once again start checkout. This would create 2 Started Checkout events linking to the same cart but with different set of items. There is no way to sort of update the event in Klaviyo. The flow would treat it like the user visited the store twice and would send 2 abandoned cart emails.
What if the user starts checkout, the event is emitted, but then the user goes back for whatever reason and removes/adds an item to then once again start checkout. This would create 2 Started Checkout events linking to the same cart but with different set of items. There is no way to sort of update the event in Klaviyo. The flow would treat it like the user visited the store twice and would send 2 abandoned cart emails.
To handle this scenario, you can limit how often a profile enters the flow.
Another flow filter you might want to add is Hasn't been in flow in the last X days. This will prevent those who recently received your abandoned cart messages from receiving them again within the specified timeframe.
Click on the trigger.
Choose Flow Filters.
Click the Add a Flow Filter button.
Choose Has not been in this flow.
Select hours, days, or weeks.
Type the amount of time you want to prevent someone from entering the flow again.
What if the user starts checkout, the event is emitted, but then the user goes back for whatever reason and removes/adds an item to then once again start checkout. This would create 2 Started Checkout events linking to the same cart but with different set of items. There is no way to sort of update the event in Klaviyo. The flow would treat it like the user visited the store twice and would send 2 abandoned cart emails.
To handle this scenario, you can limit how often a profile enters the flow.
Another flow filter you might want to add is Hasn't been in flow in the last X days. This will prevent those who recently received your abandoned cart messages from receiving them again within the specified timeframe.
Click on the trigger.
Choose Flow Filters.
Click the Add a Flow Filter button.
Choose Has not been in this flow.
Select hours, days, or weeks.
Type the amount of time you want to prevent someone from entering the flow again.
You’re thinking too ‘old school’ where you’re trying to update the ‘cart’ record in Klaviyo. There is no such thing. Its a bit ‘there is no spoon’ but once you understand that it will all make sense.
I would make a tweak to saulblum’s solution above - that solution will cause the most recent cart event to be skipped. Rather than skip anyone who has not been in the flow, I would *kick* anyone who is already in the flow that way you can put them in. i.e. If a new event occurs which also triggers the same flow the first event gets dropped.
This is what will happen with this flow filter. If a customer is already in this flow they’ll get dropepd once the ‘Added to Cart’ event fires. The ‘Added to Cart’ event itself will insert the customer into the flow anew.