Recommendation Callbacks
The JS API can be used to register callbacks to hook into the recommendation events. To register a listener for a callback, use api.listen(callbackId, callbackFunction)
function.
Post Render Callback
Called when Nosto has responded and finished recommendation placement.
Fields
Field | Type | Reason |
---|---|---|
filledElements | Array | Contains a list of recommendation slots that contain recommendations |
unFilledElements | Array | Contains a list of recommendations slots that did not have get recommendations. |
Pre Render Callback
Called when Nosto has responded but not yet rendered content. The event contains information about the visitor's preferences.
Fields
Field | Type | Reason |
---|---|---|
affinityScores | Object | Describes visitor's most preferred brands and categories, the object has two attributes top_brands and top_categories which are arrays that contain maximum 5 most preferred brands/categories for the visitor. Example content:
|
segments | Object | Information about which segments the visitor falls into. active_segments field contains a list of segment identifiers that were active on the latest request to Nosto. Segment identifiers can be retrieved from the Nosto backend, or queried from the GraphQL API. Example content:
|
Last updated