Upsell & Cross-Sell
Usage
Use the following code to retrieve product recommendations data
Example
window.FastSimonSDK.productRecommendation({
productID: "1233231",
specs:[
{
sources: ["similar_products", "similar_products_by_attributes"],
maxSuggestions: 5,
widgetID: "my-widget",
}
],
callback: (response) => {
// draw widget
}
});
Options
Option | Type | Description |
---|---|---|
productID | string (required) | response will be based on this product |
callback | (Response) => void (required) | callback to handle the results |
recent | string[] | add tracked recent product ids, example: ["2323","123"] |
specs | Specs [ ] | a list of widget specs- this will decide on what the recommendations will be based on |
withAttributes | boolean | include product attributes in the response |
Response
TypeScript Typing
interface Widget {
productID: string
widgetID: string
categoriesIDs: string[]
payload: Product[]
sources: string
}
interface Response {
action: "recommendations",
payload: Widget[]
}
Reporting Implementation (must for analytics)
Please follow the guideline to report shopper behaviour on the recommendation widget in order to get accurate Analytics in the Fast Simon dashboard as well as greater personalized accuracy
- Products Viewed From Upsell/Cross-Sell - report whenever product is clicked from the widget