Empty data in context, error
AnsweredI am getting a lot of errors saying "Empty data in Context, "http://xyz.com". But, when I do 'DY.recommendationContext' in the console, I can see that the page type and data information is already present over there.
-
Hi Karan Tomar Hope you're well! Can you make sure that the data is formatted as a string? If it's not, then you'll get this error. Please see examples for PDP and Category pages below. Hope this helps!
DY.recommendationContext = {type:'CATEGORY', data: ['Women', 'Accessories','Hats']};
DY.recommendationContext = {type:'PRODUCT', data: ['SKU123']};
-
Hi @...
Hope you are doing good as well!
Thanks for the reply and your solution solved my problem. I was not passing product Id as a string, but now it works well.
Also, I hope it's okay if we pass product Id instead of product SKU.
DY.recommendationContext = { type: "PRODUCT", "data": [ "625" ] } -
Hi Karan Tomar,
The data passed in the context should match the following:- Product pages - the SKU field in the feed
- Category pages - the categories field in the feed
Please sign in to leave a comment.
Comments
4 comments