Skip to content
Warning:
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.

Impressions

Tracking impressions allows you to learn what specific users are not interested in. If the app often shows posts about football, and the user never engages with those posts, we can conclude that we're displaying the wrong content. The code below shows how to track that a user viewed 3 specific activities:

JavaScript
const impression = {
  content_list: [
    {
      foreign_id: "post:42",
      actor: { id: "user:2353540" },
      verb: "share",
      object: { id: "song:34349698" },
    },
  ],
  feed_id: "timeline:tom",
};

client.trackImpression(impression);

Be sure to use the same Foreign Ids as used in your feeds. This allows Stream to understand the content of the activities.

Parameters

name type description default optional
content_list list of strings or objects The list of content the user is looking at. Either a list of IDs or objects. -
feed_id string The feed the user is looking at. -
location string The location in your app (i.e. email, homepage, profile page, etc.) -