Level 2
October 7, 2024
Solved
Adobe Target Recommendation Activity: The Most Viewed Products from Across the Site Algo
- October 7, 2024
- 1 reply
- 3327 views
Hello,
I am using the following algorithm to display the most viewed products ro teh customer as recommendations. However, I could not get any recommendations, so I am wondring what went wrong. For the contex, I am using the following JS code to push every viewed product to the mbox, but when I want to fetch recommendations, I got nothing. Any thought? Does the algo requires more time before generating the recommendations.
### JS Code ###
adobe.target.getOffer({
"mbox": "target-global-mbox",
"params": {
"entity.id": product.Key
},
"success": function(offer) {
const recommendation = offer[0].content;
console.log("Result: " + recommendation);
// Store the recommendation in localStorage
localStorage.setItem('recommendation', recommendation);
},
"error": function(status, error) {
console.log('Error', status, error);
}
});
}