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 events.
A product can represent anything from a catalog item to a service offering or even a subscription plan.
Make sure your app is tracking the Product viewed event before using this expression. Without this event, the expression will always evaluate to false.
Syntax
The basic syntax for this expression is:
user has viewed product
You can optionally include the article for better readability:
user has viewed a product
The negation of the expression can be expressed as:
user has not viewed product
You can refine the expression with filters, quantifiers, and time windows:
user has viewed product /*<criteria>*/ /*<quantifier>*/ /*<window>*/
Parameters
- criteria(optional)
Additional filtering criteria for the product viewed event.
- quantifier(optional)
A quantifier to specify how many times the product must have been viewed.
- 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:
- id
The ID that uniquely identifies the product on your store. For example, "3108" or "CD4371".
- sku
The SKU of the product. For example, "IPH-GRE-64", "153-169-172-182887".
- name
The name of the product. For example, "iPhone" or "Nike Air Max".
- category
The category of the product. For example, "Smartphones" or "Running shoes".
- brand
The brand of the product. For example, "Apple" or "Nike".
- variant
The variant of the product, such as size, color and style. For example, "Black", "M", "XL".
- displayPrice
The price of the product displayed in the store. For example, 899.99.
- originalPrice
The regular price of the product before any discounts. For example, 999.99.
- url
The URL of the product page.
- imageUrl
The URL of the product image.
Examples
You can check whether a user has viewed any product:
user has viewed product
Or check if they have not viewed any product:
user has not viewed product
You can also check if the user viewed a specific product by name:
user has viewed product with name "Product One"
Or check how many times products were viewed:
user has viewed product exactly 3 times
You can even filter by time, such as checking if a product was viewed yesterday:
user has viewed product yesterday
Combine criteria, counts, and time windows in one expression:
user has viewed product with name "Product One" at least 2 times this week