# Building a cart-abandoner audience from Hydrogen store events

Asked by priya_d on 2026-06-24. Tags: shopify, hydrogen, audiences, cql.

Auto cart events are flowing from the Hydrogen SDK. I want a win-back banner for
shoppers who abandoned carts more than once. Tried this condition and it never
matches anyone:

```cql
user's cartAbandonments is greater than 1
```

The audience estimator shows zero even though the cartAbandoned events are
visible in the sessions view. What is the correct condition for repeat cart
abandoners

## 1 answer

### Answer from Dana Whitfield (2026-06-24)

`cartAbandonments` is not an attribute that exists, and CQL evaluates
undefined variables to false by design, which is why the estimator shows zero
instead of an error. The documented behavioral condition is what you want:

```cql
user has abandoned a cart at least 2 times
```

That reads directly off the cartAbandoned events you are already collecting.

If you also want to catch people who are mid-abandonment right now, cart
attributes are queryable in the same audience:

```cql
cart's stage is "checkout" and cart's subtotal is less than 100
```

Audiences evaluate in real time per interaction, so the banner reacts within
the same session rather than waiting for some batch job to classify the user.

#### Reply from priya_d (2026-06-25)

The behavioral form matches now, estimator went from zero to a plausible
count. Good to know about undefined evaluating to false.
