# Event experienced

Learn how to check whether a user has experienced a custom event.

This expression checks whether a [custom event](/reference/event/types/engagement/event-occurred) occurred for the user. Custom events allows tracking specific actions that are not covered by standard events, such as "subscription-applied", "newsletter-joined", or any other action relevant to your application.

> **Tracking required**
>
> This expression uses the [Event occurred](/reference/event/types/engagement/event-occurred) event. Without this event, the expression will always evaluate to false.

## Syntax

The basic syntax for this expression is:

```cql
user has experienced custom event /*<name>*/
```

You can optionally include the article for better readability:

```cql
user has experienced a custom event /*<name>*/
```

The negation of the expression can be expressed as:

```cql
user has not experienced a custom event /*<name>*/
```

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

```cql
user has experienced a custom event /*<name>*/ /*<criteria>*/ /*<quantifier>*/ /*<window>*/
```

### Parameters

These are the supported parameters:

- `name`: `String`

  The [name](/reference/event/types/engagement/event-occurred#eventoccurred-name-prop) of the custom event.

  For example, "subscription-applied", "newsletter-joined".

- `criteria`: [`Criteria`](https://www.google.com/search?q=/reference/cql/expressions/events/criteria/overview) (optional)

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

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

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

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

  The time window during which the custom event must have been occurred.

## Event properties

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

- `details`: `object`

  The details of the event.

  For example:

  ```json
  "details": {
    "productId": "12345",
    "rating": 5
  }
  ```

## Examples

You can check whether a user has experienced a specific custom event:

```cql
user has experienced a custom event "subscription-applied"
```

Or check that the user has not experienced it:

```cql
user has not experienced a custom event "subscription-applied"
```

You can also add criteria, for example verifying a rating stored inside [details](#order-placed-properties-details-prop):

```cql
user has experienced a custom event "product-rated" with details.rating 5
```

Or check if a user experienced a custom event exactly 3 times:

```cql
user has experienced a custom event "product-rated" exactly 3 times
```

You can even filter by time, such as checking if it happened yesterday:

```cql
user has experienced a custom event "subscription-applied" yesterday
```

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

```cql
user has experienced a custom event "product-rated" with details.rating 5 at least 2 times last month
```

> **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/engagement/event-occurred): Learn how to track this event.
