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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Create an mbox with at.js 2.x

LordOfTheRings
Level 7
Level 7

Hi Team,

 

mboxCreate method doesn't work with at.j.
How could we create an mbox div at page level?

I tried with below code but no luck :

 

<div class="mboxDefault">
adobe.target.getOffer({
"mbox": "customTestMbox",
"params": {
"status": "true"
},
"success": function(offer) {
adobe.target.applyOffer( {
"mbox": "customTestMbox",
"offer": offer
} );
},
"error": function(status, error) {
console.log('Error', status, error);
}
});
</div>

1 Accepted Solution
surebee
Correct answer by
Employee
Employee
4 Replies
surebee
Correct answer by
Employee
Employee
LordOfTheRings
Level 7
Level 7
Sure @surebee, But m getting error now as :index.html:826 Uncaught ReferenceError: adobe is not defined
LordOfTheRings
Level 7
Level 7

Hi @surebee @Amelia_Waliany Target library is loaded async through launch so when the below code is getting executed the target is not loaded and hence m getting the error. I tried loading the below code  async also but that is not helping either. I need to fire target library async only. How could I fix it. Any inputs in this regard is highly appreciated.

 

<div class="mboxDefault">This is a test Mbox</div>

 

<script type="text/javascript" async>

adobe.target.trackEvent({

    "mbox": "orderConfirmPage",

    "params":{ 

        "orderId": transactionID, 

        "orderTotal": cartTotal

    }

});

</script>

LordOfTheRings
Level 7
Level 7

Hi @surebee @amelia I was getting error Adobe not defined so I have fired the orderconfirmPage mbox via page load rule in launch. I can see this getting fired now.orderConfirmPage.png

Amelia_Waliany
Employee
Employee

Hi @LordOfTheRings

 
Our next Adobe Target Skill Builder Webinar is right around the corner on May 5th, and will be presented by Adobe Target Product Management on migrating Adobe Target’s mbox.js to At.js. Check out this community discussion to register today. Hope you can make it!
 
Warmly,
Amelia