Inject Entities using Mbox for Produc Rec. | Community
Skip to main content
Luca_Lattarini
Level 9
September 21, 2021
Solved

Inject Entities using Mbox for Produc Rec.

  • September 21, 2021
  • 2 replies
  • 1371 views

Hello guys,

Is it possible to inject multiple entities via targetPageParams()? 

 

Thanks

Luca

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Gokul_Agiwal

Hi @luca_lattarini 

I think you're looking to implement Recommendations for product page is this understanding correct? 

 

If so, then yes it's possible to inject multiple entities to targetPageParams function.

If you pass all parameters on the page, you can quickly make updates by updating the page. 

 

On a product page, you might want to recommend specific items, or items with a particular price or inventory level. For a product page, you might need to set up frequently changing attributes (such as value and inventory), in addition to the keys required for a category page.

 

Recommendations require an at.js reference on the page.

For example, you can use the following code in the header section of your product pages:

function targetPageParams() { 
   return { 
      "entity": { 
         "id": "37895", 
         "categoryId": "My Category", 
         "value": 100.56, 
         "inventory": 399 
      } 
   } 
}

Hope this helps. Thanks 

2 replies

Gokul_Agiwal
Community Advisor
Gokul_AgiwalCommunity AdvisorAccepted solution
Community Advisor
September 21, 2021

Hi @luca_lattarini 

I think you're looking to implement Recommendations for product page is this understanding correct? 

 

If so, then yes it's possible to inject multiple entities to targetPageParams function.

If you pass all parameters on the page, you can quickly make updates by updating the page. 

 

On a product page, you might want to recommend specific items, or items with a particular price or inventory level. For a product page, you might need to set up frequently changing attributes (such as value and inventory), in addition to the keys required for a category page.

 

Recommendations require an at.js reference on the page.

For example, you can use the following code in the header section of your product pages:

function targetPageParams() { 
   return { 
      "entity": { 
         "id": "37895", 
         "categoryId": "My Category", 
         "value": 100.56, 
         "inventory": 399 
      } 
   } 
}

Hope this helps. Thanks 

Gaureshk_Kodag
Adobe Employee
Adobe Employee
September 21, 2021

Hi @luca_lattarini 

As @gokul_agiwal suggested, you can definitely inject multiple entity/entity attributes into mbox and use those to create collection as well, without uploading feeds.

 

 

Luca_Lattarini
Level 9
September 22, 2021

How can I insert Multiple Entity? And How can I update single entity or the entire collection of Article?