Let's say you have a specific set of items on sale and want to make sure users see the items that are most relevant to them. You can use LiftIgniter to rank just those items for each user who visits the page, and show the items most likely to catch their attention at the top of the display area.
Using "Items To Rank"
You can send us the list of items to be ranked in the "itemsToRank" field as part of the $p("register") function.
$p('register', { max: 5, widget: 'default-widget', opts: {itemsToRank: ["list","of","items"]}, callback: function(resp) { // You might wish to wrap the code in this callback inside jQuery, to handle load order issues //render the recommendations rendering_callback(resp); // track the recommendation area as the control or 'base' slice. trackAlgo('LI'); } } ); $p('fetch');
Note that we will return only those items within this list that match with our existing inventory. If, for some reason, you want to have us try and rank items including ones that are not in our inventory, you can set useInventory to false in the options.
$p('register', { max: 5, widget: 'default-widget', opts: {itemsToRank: ["list","of","items"], "useInventory": "false"}, callback: function(resp) { // You might wish to wrap the code in this callback inside jQuery, to handle load order issues //render the recommendations rendering_callback(resp); // track the recommendation area as the control or 'base' slice. trackAlgo('LI'); } } ); $p('fetch');
If you are using the API, the field name is also called "itemsToRank" and is simply sent as another parameter in the /model endpoint request.
curl -X POST \ https://query.petametrics.com/v2/model \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "apiKey" : "your-API-key-here", "url" : "http://www.domain.com/current-url", "itemsToRank" : ["http://www.dummydomain.com/articles/abc","http://www.dummydomain.com/articles/123","http://www.dummydomain.com/articles/xyz"], "userId" : "xxxxxxx" }'
Re-ranking for Long Lists
If the number of items you wish to rank is very large, the GET query that gets sent to our servers can get extremely long. As a rule of thumb, if the number of items you wish to rank exceeds 25, you are likely to hit URL length limits.
We offer a solution to this problem by allowing you to specify a common prefix to prepend to all the items to rank in the "itemsToRankPrefix". Explicitly, let's say all your items have http://dummydomain.com/articles/ in the beginning. Then, you can send:
$p('register', { max: 5, widget: 'default-widget', opts: {itemsToRankPrefix: "http://www.dummydomain.com/articles/", itemsToRank: ["a","b","c"]}, callback: function(resp) { // You might wish to wrap the code in this callback inside jQuery, to handle load order issues //render the recommendations rendering_callback(resp); // track the recommendation area as the control or 'base' slice. trackAlgo('LI'); } } ); $p('fetch');
This significantly reduces the number of characters in the query string, allowing more items to be included. The exact number will depend on the average length of the rest of the URL path for your particular items.