Last updated: Jan 10 2018

Area: Episerver Perform, Episerver Reach Applies to versions: Not applicable

Recommendations callback

Episerver returns recommendations in the form of a JavaScript callback method. When the recommendations are ready, they are passed to this callback function in the form of JSON data.

var PeeriusCallbacks={
    smartRecs:function(jsonData) {
        // implementation ….
    }
}

 The jsonData parameter is a list of recommendation widget elements that have the following properties.

NameDescriptionUsage

widget

Name of widget

[String] This should be used for information only and will vary during A/B testing.

To determine where to place a widget on the page, use the position attribute, below.

alias

Alias of the widget [String] This is used internally by Episerver Personalization. It should be used for information only.

position

Name of the page position for this widget

[String] This attribute should be used to determine the page position in which to show the widget. It needs to be a unique ID.

This value is stable and should be used to reference (rather than widget).

           

recs

A list of recommendations

 

             

img

URL of the product image [String]
   

title

Product title [String]
   

url

URL to the item's product page [String]
   

refCode

Product reference code [String]
   

prices

 

A map in which

  • the key is the currency name (such as USDGBP, and so on)
  • the value is a map with unitPrice and salePrice properties.
 
              unitPrice The item's price per unit [Number]
      salePrice The item's sale price  [Number]
   

id

Recommendation id [64bit Number] This is used for marking clicks – see Marking clicks.
    attributes A list of attributes and their values Attributes requested in the tracking request- see Additional attributes in recommendations.

Comments