Trending Products
If you haven't gone through the prerequisites and the v2 structure, please have a look at Overview
Klevu can power a recommendation banner showcasing the most popular products in the store. The most common placements for this banner type are:
Homepage: Trending Products Show a recommendation banner with the most popular products across the entire store.
Homepage: Trending Products For You Present the most popular products in the store, tailored to the customer's recent history.
Category Page: Trending in {Category} Show a banner with the most popular products in the current category. If you already have Klevu powered category product listings, add this banner with personalisation enabled so the customer sees something, different just for them
var data = JSON.stringify({"recordQueries":[{"id":"recsTrending","typeOfRequest":"RECS_TRENDING","settings":{"query":{"categoryPath":"Mens Sweaters"},"personalisation":{"enablePersonalisation":true},"context":{"recentObjects":[{"typeOfRecord":"KLEVU_PRODUCT","records":[{"id":"34322416828547"},{"id":"34322607374467"}]}]},"typeOfRecords":["KLEVU_PRODUCT"]}}],"context":{"apiKeys":["klevu-158755634955912036"]}});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://eucs19v2.ksearchnet.com/cs/v2/search");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);