# Product viewed

Learn how to check if a user has viewed specific products.

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

A product can represent anything from a catalog item to a service offering or even a subscription plan.

## Syntax

The basic syntax for this expression is:

```cql
user has viewed product
```

You can optionally include the article for better readability:

```cql
user has viewed a product
```

The negation of the expression can be expressed as:

```cql
user has not viewed product
```

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

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

## Parameters

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

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

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

  A quantifier to specify how many times the product must have been viewed.

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

  The time window during which the product must have been viewed.

## Event properties

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

- `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 viewed any product:

```cql
user has viewed product
```

Or check if they have not viewed any product:

```cql
user has not viewed product
```

You can also check if the user viewed a specific product by name:

```cql
user has viewed product with name "Product One"
```

Or check how many times products were viewed:

```cql
user has viewed product exactly 3 times
```

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

```cql
user has viewed product yesterday
```

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

```cql
user has viewed product with name "Product One" at least 2 times this week
```

> **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-viewed): Learn more about this event.
