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 event. 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 postYou can optionally include the article for better readability:
user has viewed a postThe negation of the expression can be expressed as:
user has not viewed postYou can refine the expression with filters, quantifiers, and time windows:
user has viewed post /*<criteria>*/ /*<quantifier>*/ /*<window>*/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.
The set of tags associated with the post. For example, "startup", "product", "dev-tools".
- categoriesarray<string>
The categories the post belongs to. For example, "news", "updates", "releases".
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 postOr verify they have not viewed any post:
user has not viewed postYou can also check if the user viewed a specific post by title:
user has viewed post with title "Personalization strategies"Or check how many times posts were viewed:
user has viewed post exactly 3 timesYou can even filter by time, such as checking if a post was viewed today:
user has viewed post todayCombine criteria, counts, and time windows in one expression:
user has viewed post with title "Personalization strategies" exactly 2 times last week