Overview
Learn how to use event expressions in CQL.
Event expressions let you define conditions based on the history of events in a user's journey. For example, you can check whether a user viewed a specific page today or yesterday, or if they recently abandoned a cart.
Syntax
An event expression starts with an event type, and may include criteria, a quantifier, or a time window:
user has /*<event>*/ /*<criteria>*/ /*<quantifier>*/ /*<window>*/
You can also use negation with not:
user has not /*<event>*/
Here's how you could check if a user has shown interest in smartphones:
user has shown interest in "smartphone"
Building blocks
These are the parts that make up an event expression:
- event
The specific event type to check for.
- criteria(optional)
Conditions that further refine which events qualify.
- quantifier(optional)
The number of times the event must have occurred.
- window(optional)
The period during which the event must have occurred.
Event types
These are the available event types you can use in your expressions:
Expression | Event type |
---|---|
user has abandoned a cart | Cart abandoned |
user has abandoned a product | Product abandoned |
user has viewed a product | Product viewed |
user has placed an order | Order placed |
user has ordered a product | Product ordered |
user has viewed a campaign | Campaign viewed |
user has viewed a page | Page viewed |
user has viewed a post | Post viewed |
user has opened a link | Link opened |
user has shown interest in /*<topics>*/ | Interest shown |
user has experienced a custom event /*<name>*/ | Event experienced |
user has completed goal /*<goal-id>*/ | Goal completed |
user has signed in | Signed in |
user has signed up | Signed up |