Loading...
Area: Episerver Perform, Episerver Reach
Applies to versions: 1.0 and higher (JavaScript API)

Additional attributes in recommendations

If the Recommendations product was enabled for the current page, you can request that additional product attributes (such as star ratings) are supplied in the smartRecs callback.

NameDescriptionUsage

smartRecs

   
            showAttributes Controls which attributes to show in the smartRecs callback

[Optional]
A comma-separated list of attribute names to send in the smartRecs callback. If this property is not supplied, no attributes are sent. If this property is set to "*", all available attributes are sent.

            markRecsAsShown Whether all recommendations sent as the response are rendered.

[Optional]

This must be included if a subset of recommendations sent as the response is rendered on the front end of your site/application.

Default is true; that is, all recommendations in the response are assumed to have been rendered. 

If set to false, an additional API call needs to be made to inform Episerver of the IDs of recommendations that have been rendered. See Impression tracking.

For example, on a product page tracking request, to show all attributes for the recommended products, send the following.

<script> 
	PeeriusCallbacks.track={ 
		type:"product", 
		lang:"en-gb", 
		"smartRecs": {
    		  "showAttributes": ["*"]
  		},
                product: { 
			refCode:"PROD500" 
		} 
	} 
</script>

If you want the callback to contain only the attribute "starrating", for each recommended product, send the following.

<script> 
	PeeriusCallbacks.track={ 
		type:"product", 
		lang:"en-gb", 
		"smartRecs": {
    		  "showAttributes": ["starrating"]
  		},
                product: { 
			refCode:"PROD500" 
		} 
	} 
</script>

Last updated: Nov 06, 2017

Feedback?