Skip to content

User Engagement

User Engagement lets you capture how a recognized shopper feels about every product, variant, and piece of content they interact with. Shoppers can explicitly favorite items (❤️) and assign sentiment (👍/👎), and Relewise remembers their choices so you can reflect them anywhere you display results.

Once tracked, the current engagement state can be returned inline in Search and Recommendation responses. That makes it straightforward to show filled hearts and thumb states on product listing pages, detail pages, content lists, or any Relewise-powered carousel. Ranking impact is opt-in and controlled through Merchandising or at the API request level through Filters and Relevance Modifiers when you decide it is appropriate.

Identify your user

User Engagement relies on the same user identifiers that you already send to Relewise for behavioral tracking. Temporary or Authenticated IDs ensure that favorites and sentiments can be persisted and retrieved for each shopper.

Tracking Engagement Events

Engagement events are tracked with the Tracker API in exactly the same way as other behavioral events. Each event contains:

  • The User whose engagement should be recorded.
  • The entity identifier (Product ID, Variant ID, or Content ID).
  • Engagement data describing whether the entity is favorited and/or which sentiment to store (Like, Dislike, or Neutral).
ts
await tracker.trackProductEngagement({
    user: UserFactory.byTemporaryId('user-id'),
    product: {
        productId: 'product-id',
    },
    engagement: {
        isFavorite: true,
    },
});

Use the corresponding ContentEngagement type to store favorites and sentiment for other non-product entities.

Requesting Engagement in Responses

User Engagement is an optional payload on each result. To have Search or Recommendation responses include the engagement state, enable the UserEngagement flag in the selected properties of your request settings.

ts
const builder = new ProductSearchBuilder(settings)
    .setSelectedProductProperties({
        displayName: true,
        userEngagement: true,
    })
    .setTerm('shoe')
    .pagination(p => p
        .setPageSize(30)
        .setPage(1));

The same flag exists for content responses through SelectedContentPropertiesSettings.

ts
const builder = new PersonalContentRecommendationBuilder(settings)
    .setSelectedContentProperties({
        displayName: true,
        userEngagement: true,
    })
    .setNumberOfRecommendations(10);

await recommender.recommendPersonalContents(builder.build());

Once included in responses, you can optionally apply request-level modifiers to boost or bury items based on engagement, or filter to the states that best match the experience you are building.

When enabled, each result contains a UserEngagement object:

FieldDescription
IsFavoritetrue if the shopper has marked the entity as a favorite.
SentimentThe shopper's latest sentiment (Like, Dislike, or Neutral).

If the shopper has not expressed an opinion, the UserEngagement property will be null, and you can default to your standard UI.

With this in place, you can confidently surface hearts and thumbs anywhere in your experience, giving shoppers immediate feedback on their saved and rated items.

Don't know us? Don't worry - you can find more information about us, by visiting our main page www.relewise.com