Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

updating mbox parameters using at.js

Avatar

Avatar
Validate 1
Level 2
Chand856
Level 2

Likes

6 likes

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Chand856
Level 2

Likes

6 likes

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
Chand856
Level 2

21-11-2017

Please help me on the below.

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

Replies

Avatar

Avatar
Validate 250
Employee
Amelia_Waliany
Employee

Likes

182 likes

Total Posts

439 posts

Correct Reply

72 solutions
Top badges earned
Validate 250
Validate 100
Validate 50
Validate 25
Validate 10
View profile

Avatar
Validate 250
Employee
Amelia_Waliany
Employee

Likes

182 likes

Total Posts

439 posts

Correct Reply

72 solutions
Top badges earned
Validate 250
Validate 100
Validate 50
Validate 25
Validate 10
View profile
Amelia_Waliany
Employee

21-11-2017

Hi there and thanks for your question! You might find this article in the Target Documentation helpful. Feel free to reach out again if you have any other questions!

Avatar

Avatar
Validate 1
Level 2
Chand856
Level 2

Likes

6 likes

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Chand856
Level 2

Likes

6 likes

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
Chand856
Level 2

27-11-2017

Hi,

mboxUpdate

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.

adobe.target.getOffer ({

"mbox": "target-global-mbox",

"success": function(offers) {

adobe.target.applyOffer( {

"mbox": "target-global-mbox",

"offers": [{

"actions" :

"content" : [{

"profile.recurringClient" : +digital_data.previousBookingInfo.recurringClient,

"profile.familyBooking" : +digital_data.previousBookingInfo.familyBooking

}]

}

}]

} );

Avatar

Avatar
Boost 5
Employee
arturc85303583
Employee

Likes

12 likes

Total Posts

13 posts

Correct Reply

7 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile

Avatar
Boost 5
Employee
arturc85303583
Employee

Likes

12 likes

Total Posts

13 posts

Correct Reply

7 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile
arturc85303583
Employee

29-11-2017

hello bhanuc99794808​,

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)

applyOffer() - is responsible for rendering the offers received from Target. All the applyOffer() options are listed here: adobe.target.applyOffer(options)

If you try to execute a custom global mbox request and you want to use additional parameters, here is how you can do it:

<script>

adobe.target.getOffer({ 

  "mbox": "target-global-mbox",

  "params": {

    "a": 1,

    "b": 2

  },

  "success": function(offers) { 

    adobe.target.applyOffer( {

      "mbox": "target-global-mbox",

      "offer": offers

    });

  }, 

  "error": function(status, error) {

    console.log('Request failed', status, error);

  }

});

</script>

NOTE: the params option, which you can use to send additional parameters to Target edge.

I hope this helps.