Cart abandoned
Learn how to check whether a user has abandoned a cart.
This expression checks whether the user abandoned a cart based on Cart abandoned events.
A cart is considered abandoned when a user adds items but does not complete the purchase before the session ends. When the session ends, that cart and its items are marked as abandoned.
Ensure your app tracks the Cart modified or Cart viewed events. Otherwise, the expression will always evaluate to false.
Syntax
The basic syntax for this expression is:
user has abandoned a cart
The negation of the expression can be expressed as:
user has not abandoned a cart
You can refine the expression with filters, quantifiers, and time windows:
user has abandoned a cart /*<criteria>*/ /*<quantifier>*/ /*<window>*/
Parameters
These are the supported parameters:
- criteria(optional)
Additional filtering criteria for the cart abandoned event.
- quantifier(optional)
A quantifier to specify how many times the event must have occurred.
- window(optional)
The time window during which the cart abandonment must have occurred.
Event properties
The following event properties can be used within criteria expressions:
- currency
The currency in which the monetary values are expressed in the shopping cart, such as "USD" or "EUR".
- subtotal
The total of all items and quantities in the shopping cart including applied item promotions.
- shippingPrice
The total shipping price for the items in the shopping cart, including any handling charges.
- taxesobject
The taxes associated with the transaction.
It is expressed as a dictionary where the key is the tax name and the value is the tax amount.
Example:
{ "state": 3.1, "local": 1.5}
- costsobject
The costs associated with the transaction, such as manufacturing costs, shipping costs not paid by the customer, or other costs.
It is expressed as a dictionary where the key is the cost name and the value is the cost amount.
Example:
{ "manufacturing": 5.0, "packaging": 2.0}
- discount
The amount of discount applied to the shopping cart, as an absolute value. For example, 10.00 for a $10 discount.
- coupon
The coupon applied to the shopping cart. For example, "SUPER_DEALS".
- total
The total revenue or grand total associated with the transaction, including shipping, tax, and any other adjustment.
Examples
You can check if a cart was abandoned:
user has abandoned a cart
Or verify that no cart was abandoned:
user has not abandoned a cart
You can also add conditions, such as checking if the cart's currency was USD:
user has abandoned a cart with currency "USD"
Or the number of carts abandoned:
user has abandoned a cart at least 2 times
You can even filter by time, such as checking if it was abandoned yesterday:
user has abandoned a cart yesterday
Combine filters, counts, and time windows in one expression:
user has abandoned a cart with currency "USD" at least 1 time last week