Follow

Recommender object

Recommenders should be added to our BrainSINSData Object. The following is an example of how it should be created with just the essentials to work:

<script type="text/javascript">    
var BrainSINSData = {       
pageType:"home",       
recommenders: [ {
recommenderId: ID,
location: LOCATION,
position: POSITION
}]
};
</script>

How to configure the parameters:

  • recommenderId: the id of recommender. You can find it in recommenders list.
  • location: referential html element. You can use id or class of the element. It should be refereed as jQuery or CSS with "." for classes and "#" for id.
  • position: can be "before", "after", "replace", "first" or "last".

You also can use the following parameters in order to give recomenders more accuracy:

  • categories: this is a typical parameter of category page but you can use it inside a recommender object in other pages to filter by one or more categories (separated by commas). This parameter only affect the concrete recommender where it's placed.
  • filter: can be "any", "all" or "forbid". If you don't configure it, the categorie parameter won't have effect. You also can use it in recommenders in category page with the categories parameter outside recommender object. 

    • any: recommender will show products that contain almost one category.
    • all: the products must contain every category from categories parameter to be shown in recommenders.
    • forbid: products with the same categories as categories parameter won't be shown in recommenders.

For instance, if you want two recommenders in home page, one with recommender id 1 (Based on your last item visited) and the second one with id 2 (Top Selling): 

<script type="text/javascript">    
var BrainSINSData = {       
pageType:"home",       
recommenders: [ {
recommenderId: 1,
location: "#brainsins_rec",
position: "replace"
},{
recommenderId: 2,
location: ".main_row",
position: "after",
categories: "t-shirt,red",
filter: "forbid"
}
]
};
</script>
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk