Recombee AddToCartAddition icon

Recombee AddToCartAddition

Records when a user adds an item to their shopping cart. Cart additions indicate purchase intent and help improve recommendation accuracy. This operation is essential for tracking shopping behavior

Overview

This node records events when a user adds an item to their shopping cart in an e-commerce context. Tracking these "add to cart" actions helps capture purchase intent, which is valuable for improving recommendation algorithms and understanding user shopping behavior. For example, an online store can use this node to log each time a customer adds a product to their cart, enabling personalized product recommendations based on recent user interest.

Common scenarios include:

  • Enhancing recommendation accuracy by feeding real-time cart addition data into a recommendation engine.
  • Analyzing shopping trends and user preferences.
  • Associating cart additions with specific marketing campaigns or recommendations.

Properties

Name Meaning
User ID The ID of the user who added the item to the cart.
Item ID The ID of the item that was added to the cart.
Cascade Create Whether to create the item in the system if it does not already exist (true/false).
Amount Optional number of items added to the cart; defaults to 1 if not specified.
Timestamp Optional timestamp indicating when the item was added; if omitted, the current time is used.
Max Retries Number of times to retry failed batch requests, useful for handling temporary network issues or rate limits.
Recommendation ID Optional ID linking the cart addition to a specific recommendation, allowing association with marketing efforts.

Output

The node outputs an array of JSON objects, each representing the result of processing an individual "add to cart" event. Each output object includes:

  • success: Boolean indicating whether the operation succeeded.
  • Original input properties such as userId, itemId, amount, timestamp, cascadeCreate, and recommId.
  • If successful, a data field containing the response from the external service confirming the recorded event.
  • If failed, an error field describing the failure reason.

No binary data is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the external recommendation service.
  • Uses an external client library to communicate with the recommendation engine's API.
  • Node configuration must include credentials with database ID, private token, region, and optionally an API timeout setting.
  • Network connectivity to the recommendation service endpoint is necessary.

Troubleshooting

  • Network or Rate Limit Errors: The node retries batch requests up to the configured maximum retries (Max Retries). If failures persist beyond this, errors are thrown unless the workflow is set to continue on failure.
  • Invalid User or Item IDs: If the provided user or item IDs do not exist and Cascade Create is false, the request may fail. Enabling Cascade Create allows automatic creation of missing items.
  • Timestamp Format Issues: Providing an invalid timestamp may cause errors; ensure timestamps are in a valid date-time format or leave empty to use the current time.
  • Credential Misconfiguration: Missing or incorrect API credentials will prevent successful communication with the recommendation service.
  • Batch Size Limits: The node batches requests in groups of 100. Large inputs are split accordingly; extremely large datasets might require additional handling outside the node.

Links and References

Discussion