Batch mode

The recommender API supports a batch mode, where you can fetch data for several recommender boxes in one go. The concept of batching is also built-in to recco.js

There are 2 recommender boxes on this page, but the content is loaded in a single API request. Feel free to open the developer tools (usually by pressing F12 on the keyboard) and observe the activity in the Network tab.

Top products

You may like

<script>
function LBInitRecommender() {
  // populate settings
  window.Luigis = window.Luigis || {};
  window.Luigis.BatchRecommenders = {
    // settings is array of config objects
    settings: [
      {
        Selector: '#recommender-top-products', // CSS selector for render element
        TrackerId: '179075-204259',
        Theme: 'luigis',
        Size: 3,
        Name: 'top_products', // name must be unique
        Type: 'top_products'
      },
      {
        Selector: '#recommender-homepage', // CSS selector for render element
        TrackerId: '179075-204259',
        Theme: 'luigis',
        Size: 3,
        Name: 'homepage', // name must be unique
        Type: 'homepage_personalized'
      }
    ]
  };

  Luigis.Recommend('top_products');
  Luigis.Recommend('homepage');
}
</script>

<script src="https://cdn.luigisbox.com/recco.js" async onload="LBInitRecommender()"></script>
Previous example
Recommender wrappers
Recommender examples

Try it out →

Next example
Basic example
Recommender examples

Try it out →