Customers Also Viewed
2 min
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 any products which other customers also viewed, in addition to viewing the current product. The most common placements for this banner type are:
Product Page: Others Also Viewed Show a recommendation banner with products other customers viewed from the store.
Customers Also Viewed Product Recommendations
The end-point is used for retrieving customers also viewed product recommendations.
POST
https://eucs19v2.ksearchnet.com/cs/v2/search
var data = JSON.stringify({"recordQueries":[{"id":"recsAlsoViewed","typeOfRequest":"RECS_ALSO_VIEWED","settings":{"context":{"recentObjects":[{"typeOfRecord":"KLEVU_PRODUCT","records":[{"id":34322682183811}]}]},"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);Try it here!