Post viewed

Learn how to check if a user has viewed posts.

This expression checks whether the user has viewed a post based on Post viewed events. Posts represent blog articles or similar content that users can read or interact with.

Syntax

The basic syntax for this expression is:

user has viewed post
Try in Playground

You can optionally include the article for better readability:

user has viewed a post
Try in Playground

The negation of the expression can be expressed as:

user has not viewed post
Try in Playground

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

user has viewed post /*<criteria>*/ /*<quantifier>*/ /*<window>*/
Try in Playground

Parameters

criteria(optional)

Additional filtering criteria for the post view event.

quantifier(optional)

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

window(optional)

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

Event properties

The following event properties can be used within criteria expressions:

id

The unique identifier of the blog post. For example, "croct-launches-new-sdk".

title

The title of the post. For example, "Croct launches new SDK".

publishTime

The time of the post publication, in milliseconds since Unix ep

url

The URL of the post page.

tags
array<string>

The set of tags associated with the post. For example, "startup", "product", "dev-tools".

categories
array<string>

The categories the post belongs to. For example, "news", "updates", "releases".

authors
array<string>

The authors of the post. For example, "John Doe", "Jane Smith".

Examples

You can check whether a user has viewed any post:

user has viewed post
Try in Playground

Or verify they have not viewed any post:

user has not viewed post
Try in Playground

You can also check if the user viewed a specific post by title:

user has viewed post with title "Personalization strategies"
Try in Playground

Or check how many times posts were viewed:

user has viewed post exactly 3 times
Try in Playground

You can even filter by time, such as checking if a post was viewed today:

user has viewed post today
Try in Playground

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

user has viewed post with title "Personalization strategies" exactly 2 times last week
Try in Playground