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

How to access data from JSON offer through a HMTL offer?

Jennifer_Huynh
Level 3
Level 3

I created one activity with two offers.  One is Json Data Offer and another one in HTML type of offer.

In my Json offer i stored 

{

    "_id": "5a65d24d8fafc966921e9169",

    "index": 0,

    "guid": "7c006504-c6f7-468d-a46f-f72531ea454c",

    "isActive": true,

    "balance": "$2,075.06",

    "picture": "http://placehold.it/32x32",

    "greeting": "Hello, Stephenson Fernandez! You have 4 unread messages.",

    "favoriteFruit": "strawberry"

}

In my html offer.  I stored

<script>

alert("hi")

debugger;

adobe.target.getOffer({ 

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

  "params": {},

  "success": function(offer) {    

       console.log(offer[0].content[0].greeting);

  }, 

  "error": function(status, error) {         

      console.log('Error', status, error);

  }

});

</script>

I follow the steps here but it won't work   Create JSON offers https://marketing.adobe.com/resources/help/en_US/target/target/c_create_json_offer.html

0 Replies