Event experienced

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

This expression checks whether a custom event 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.

Syntax

The basic syntax for this expression is:

user has experienced custom event /*<name>*/
Try in Playground

You can optionally include the article for better readability:

user has experienced a custom event /*<name>*/
Try in Playground

The negation of the expression can be expressed as:

user has not experienced a custom event /*<name>*/
Try in Playground

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

user has experienced a custom event /*<name>*/ /*<criteria>*/ /*<quantifier>*/ /*<window>*/
Try in Playground

Parameters

These are the supported parameters:

name
String

The name of the custom event.

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

criteria(optional)

Additional filtering criteria for the event experienced.

quantifier(optional)

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

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:

details
object

The details of the event.

For example:

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

Examples

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

user has experienced a custom event "subscription-applied"
Try in Playground

Or check that the user has not experienced it:

user has not experienced a custom event "subscription-applied"
Try in Playground

You can also add criteria, for example verifying a rating stored inside details:

user has experienced a custom event "product-rated" with details.rating 5
Try in Playground

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

user has experienced a custom event "product-rated" exactly 3 times
Try in Playground

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

user has experienced a custom event "subscription-applied" yesterday
Try in Playground

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

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