# Product abandoned

Learn how to check if a user has abandoned a product.

This expression checks whether the user has abandoned a product based on [Product abandoned](/reference/event/types/ecommerce/product-abandoned) events.

A product is considered abandoned when a user views the item or adds it to the cart but does not complete the purchase before the session ends. When the session is closed, the cart and its items are marked as abandoned.

> **Tracking required**
>
> Make sure your app is tracking the [Cart modified](/reference/event/types/ecommerce/cart-modified) or [Cart viewed](/reference/event/types/ecommerce/cart-viewed) events before using this expression. Without this event, the expression will always evaluate to false.

## Syntax

The basic syntax for this expression is:

```cql
user has abandoned product
```

You can optionally include the article for better readability:

```cql
user has abandoned a product
```

The negation of the expression can be expressed as:

```cql
user has not abandoned a product
```

You can refine the expression with filters, quantifiers, and time windows:

```cql
user has abandoned a product /*<criteria>*/ /*<quantifier>*/ /*<window>*/
```

## Parameters

These are the supported parameters:

- `criteria`: [`Criteria`](/reference/cql/expressions/events/criteria/overview) (optional)

  Additional [filtering criteria](#event-properties) for the product abandoned event.

- `quantifier`: [`Quantifier`](/reference/cql/expressions/events/quantifier) (optional)

  A quantifier to specify how many times the event must have occurred.

- `window`: [`TimeWindow`](/reference/cql/expressions/events/time-window) (optional)

  The time window during which the product abandonment must have occurred.

## Event properties

The following event properties can be used within [criteria expressions](/reference/cql/expressions/events/criteria/overview):

- `index`: `number`

  The position of the item in the shopping cart, starting from 0.

  This value typically represents the order in which the items were added to the cart. For example, the first item has an index of 0, the second item has an index of 1, and so on.

- `quantity`: `number`

  The number of units of the item.

- `discount`: `number|null`

  The amount of the discount applied to the item.

- `coupon`: `string|null`

  The coupon applied to the item. For example, "SUPER\_DEALS".

- `total`: `number`

  The total for the item, including discounts and any other adjustment.

- `id`: `string`

  The ID that uniquely identifies the product on your store. For example, "3108" or "CD4371".

- `sku`: `string|null`

  The SKU of the product. For example, "IPH-GRE-64", "153-169-172-182887".

- `name`: `string`

  The name of the product. For example, "iPhone" or "Nike Air Max".

- `category`: `string|null`

  The category of the product. For example, "Smartphones" or "Running shoes".

- `brand`: `string|null`

  The brand of the product. For example, "Apple" or "Nike".

- `variant`: `string|null`

  The variant of the product, such as size, color and style. For example, "Black", "M", "XL".

- `displayPrice`: `number`

  The price of the product displayed in the store. For example, 899.99.

- `originalPrice`: `number|null`

  The regular price of the product before any discounts. For example, 999.99.

- `url`: `string|null`

  The URL of the product page.

- `imageUrl`: `string|null`

  The URL of the product image.

## Examples

You can check whether a user has abandoned any product:

```cql
user has abandoned a product
```

Or check if they have not abandoned any product:

```cql
user has not abandoned a product
```

You can also add criteria, such as requiring a coupon:

```cql
user has abandoned a product with coupon "10OFF"
```

Or check how many times products were abandoned:

```cql
user has abandoned a product at most 2 times
```

You can even filter by time, such as checking if a product was abandoned yesterday:

```cql
user has abandoned a product yesterday
```

Combine criteria, counts, and time windows in one expression:

```cql
user has abandoned a product with coupon "10OFF" exactly 2 times today
```

> **Scale plan**
>
> This feature is available only to accounts on the Scale plan. See the [pricing page](https://croct.com/pricing) for more information.

## Explore

- [Audiences](/explanation/audience): Understand how to delivery content to specific groups of users.
- [Event tracking](/reference/event/types/ecommerce/product-abandoned): Learn more about this event.
