Post viewed
Record when a user views a blog post.
This event tracks when a user views a blog post.
Track this event whenever a user views a blog post or similar form of content.
Implementation
Here is an example of how to track this event:
import croct from '@croct/plug';croct.track('linkOpened', {post: {postId: 'croct-launches-new-sdk',title: 'Croct launches new SDK',publishTime: 1499839200000}});
Input properties
These are the supported properties:
- postobject
The information about the blog post.
- postIdstring
The unique identifier of the blog post. For example, "croct-launches-new-sdk".
It is usually the "slug" of the post, or some other identifier that does not change.
The value must be between 1 and 100 characters long.
- titlestring
The title of the post. For example, "Croct launches new SDK".
The value must be between 1 and 100 characters long.
- publishTimenumber
The time of the post publication, in milliseconds since Unix epoch.
The value must be non-negative.
- url(optional)string
The URL of the post page.
The set of tags associated with the post. For example, "startup", "product", "dev-tools".
The value must be an array of up to 10 strings between 1 and 50 characters long.
- categories(optional)array<string>
The categories the post belongs to. For example, "news", "updates", "releases".
The value must be an array of up to 10 strings between 1 and 50 characters long.
The authors of the post. For example, "John Doe", "Jane Smith".
The value must be an array of up to 10 strings between 1 and 50 characters long.
- updateTime(optional)number
The time of the post's last update, in milliseconds since Unix epoch.
The value must be non-negative.
- postId
Processed properties
This event has no processed properties.
Payload examples
Below are some payload examples for this event:
{"post": {"postId": "croct-launches-new-sdk","title": "Croct launches new SDK","publishTime": 1499839200000}}