Recombee SetViewPortion icon

Recombee SetViewPortion

Sets viewed portion of an item (for example a video or article) by a user (at a session). If you send a new request with the same (userId, itemId, sessionId), the portion gets updated.

Overview

This node sets the viewed portion of an item (such as a video or article) by a user during a specific session. It records how much of the item the user has consumed, which can be useful for tracking user engagement and improving personalized recommendations.

Common scenarios include:

  • Tracking video watch progress to resume playback later.
  • Monitoring article reading progress to suggest relevant content.
  • Associating view data with recommendation IDs to analyze recommendation effectiveness.

For example, if a user watches 30% of a video in a session, this node updates that information in the recommendation system, enabling better personalization based on actual consumption.

Properties

Name Meaning
User ID The unique identifier of the user whose view portion is being updated.
Item ID The unique identifier of the item (e.g., video or article) being viewed.
Portion The fraction or percentage of the item viewed by the user (e.g., 0.3 for 30%).
Session ID The identifier of the viewing session to associate the portion with.
Timestamp Optional date and time when the view occurred; if omitted, the current time is used.
Cascade Create Whether to create the user record if it does not already exist in the system (true/false).
Recommendation ID Optional ID of a recommendation; if provided, associates the view portion with this recommendation.
Additional Data A JSON object containing extra data to set or update alongside the view portion.
Max Retries Number of times to retry failed batch requests, useful for handling temporary network issues or rate limits.

Output

The node outputs an array of JSON objects, each representing the result of setting the viewed portion for an input item. Each output object contains:

  • success: Boolean indicating whether the operation succeeded.
  • Input properties echoed back (userId, itemId, portion, sessionId, etc.).
  • userData: The response data from the recommendation API if successful.
  • error: Error message if the operation failed.

No binary data is output by this node.

Dependencies

  • Requires an API key credential for authenticating with the Recombee recommendation service.
  • Uses the Recombee API client library to communicate with the Recombee database.
  • Node configuration must include valid Recombee database ID, private token, and region.
  • Network connectivity to the Recombee API endpoint is necessary.

Troubleshooting

  • Common Issues:

    • Invalid or missing user/item/session IDs will cause errors.
    • Network failures or rate limiting may cause batch requests to fail.
    • Malformed JSON in "Additional Data" property can cause parsing errors.
  • Error Messages:

    • Errors returned from the Recombee API are surfaced in the output with details.
    • If "Continue On Fail" is disabled, the node execution stops on first error.
    • Retry logic is implemented for batch requests up to the configured max retries.
  • Resolutions:

    • Ensure all required IDs are correctly specified.
    • Validate JSON syntax in additional data.
    • Increase max retries if experiencing transient network issues.
    • Enable "Continue On Fail" to allow partial success in batch operations.

Links and References

Discussion