Try our conversational search powered by Generative AI!

Loading...
Area: Optimizely Product Recommendations
Applies to versions: v1.3 and lower

Additional attributes in recommendations

Recommended reading 

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>
Do you find this information helpful? Please log in to provide feedback.

Last updated: May 23, 2018

Recommended reading