Product ordered

Learn how to check if a user has ordered a specific product.

This expression verifies whether the user has ordered a specific product based on Product ordered events.

A product is considered ordered when the user completes the purchase and the resulting order includes that product. When the order is placed, each included item is recorded as a separate product ordered entry.

Syntax

The basic syntax for this expression is:

user has ordered product

The alternative syntax is:

user has ordered a product

The negation of the expression can be expressed as:

user has not ordered a product

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

user has ordered a product /*<criteria>*/ /*<quantifier>*/ /*<window>*/

Parameters

These are the supported parameters:

criteria(optional)

Additional filtering criteria for the product ordered event.

quantifier(optional)

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

window(optional)

The time window during which the event must have occurred.

Event properties

The following event properties can be used within criteria expressions:

index

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

The number of units of the item.

discount

The amount of the discount applied to the item.

coupon

The coupon applied to the item. For example, "SUPER_DEALS".

total

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

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 ordered a product:

user has ordered a product

Or verify that a product was not ordered:

user has not ordered a product

You can also add criteria, such as checking the product ID:

user has ordered a product with id "CD4371"

Or check how many times a product was ordered:

user has ordered a product at least 2 times

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

user has ordered a product yesterday

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

user has ordered a product with category "Beauty" at least 2 times last month