Empty data in context, error

Answered

Comments

4 comments

  • Permanently deleted user

    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']}; 

    Comment actions Permalink
  • Karan Tomar

    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" ] }

    Comment actions Permalink
  • Permanently deleted user

    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
    Comment actions Permalink
  • Karan Tomar

    Got it, thanks! @... 

    Comment actions Permalink

Please sign in to leave a comment.