i know in case of mbox.js , we have mboxUpdate() function to update mbox parameters . What is the similar one if we use at.js . I tried adobe.target.applyOffer and it is not working . Please provide some sample code
Executes the request and applies the offer to the element identified by the nodeId in the mboxDefine(). Can also be used to update an mbox initiated by mboxCreate. Built into at.js mostly to ease the transition from mbox.js to at.js. mboxDefine()/mboxUpdate() could be replaced byadobe.target.getOffer() <https://marketing.adobe.com/resources/help/en_US/target/ov2/r_target-atjs-getoffer.html#reference_C81525D1598A4A1199740DCAB81A7FDF> and adobe.target.applyOffer()<https://marketing.adobe.com/resources/help/en_US/target/ov2/r_target-atjs-applyoffer.html#reference_BBE83F513B5B4E03BBC3F50D90864245> using the selector option.
I tried using the two functions listed above and not able to update the parameters of the global mbox. The below code is showing error in console “Offers is missing” , though it is mentioned.
If you could provide more details regarding what are you trying to accomplish that would help us provide more concrete steps.
Regarding your question, at.js supports mboxUpdate(), however to make sure it behaves as expected, just as with mbox.js, you have to make sure that you first call mboxCreate() or mboxDefine() followed by mboxUpdate().
If you try to move away from old mbox APIs and you want to use the new at.js APIs like getOffer() and applyfOffer(), then there are a few things that you should be aware of: getOffer() - is responsible for sending data like mbox or profile parameters to Target edge and receiving offers. All the getOffer() options are listed here: adobe.target.getOffer(options)