The Search and Also Purchased premium recommendation algorithm requires you to implement one or two addSearch
method calls to send customers' search query data for use with a recommendation strategy configured with this recommendation type. One method call is for site search, and the other is for category search. Implementing both is preferred.
Code Samples
// Site Search
window.monetateQ.push([
"addSearch", {
"searchTerm": "this is a test",
"searchType": "site"
}
]);
window.monetateQ.push([
"trackData"
]);
// Category Search
window.monetateQ.push([
"addSearch", {
"searchTerm": "kids",
"searchType": "category"
}
]);
window.monetateQ.push([
"trackData"
]);