const engagement = {
// the label for the engagement, ie click, retweet etc.
label: "click",
// the ID of the content that the user clicked
content: {
foreign_id: "tweet:34349698",
},
// score between 0 and 100 indicating the importance of this event
// IE. a like is typically a more significant indicator than a click
score: 2,
// (optional) the position in a list of activities
position: 3,
// (optional) the feed the user is looking at
feed_id: "user:thierry",
// (optional) the location in your app. ie email, profile page etc
location: "profile_page",
};
client.trackEngagement(engagement);
client.trackEngagements([engagement1, engagement2]);You are viewing the Feeds v2 documentation. Feeds v2 is in maintenance mode and no longer receives new features. New projects should use Feeds v3, a major upgrade in performance, capabilities, and developer experience. To move an existing app, follow the migration guide.
Engagements
Tracking Engagements
The snippet below shows an example of how to track engagements. Engagement examples include likes, comments, profile views and link clicks.
Parameters
| name | type | description | default | optional |
|---|---|---|---|---|
| label | string | The type of event (i.e. click, share, search, etc.) | - | |
| content | string or object | The content the engagement related to, either as an ID or content object. | - | |
| score | string | A score between 0 and 100 indicating the importance of an event. | - | |
| position | string | The placement in a list of activities, starting at 0. | - | ✓ |
| feed_id | string | The specific feed the user is viewing | - | ✓ |
| location | string | The page in your app (i.e. email, homepage, profile page, etc.) | - | ✓ |