Passing in dynamic data into offer without reloading page | Community
Skip to main content
Level 2
January 8, 2020
Solved

Passing in dynamic data into offer without reloading page

  • January 8, 2020
  • 1 reply
  • 2315 views

I found this documentation (https://docs.adobe.com/content/help/en/target/using/experiences/offers/passing-profile-attributes-to-the-html-offer.html) which allows us to use profile data in our offers. This works however, I cannot figure out how to pull in updated data values without reloading the page. Is there a way to update the content without reloading the page? Perhaps on some sort of event listener (ex: click event)? 

 

 

Thanks!

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 richardlee-1

Hi @paul53181 

we sometimes trigger activities based click events etc using the getOffer() in the handler to retrieve the activity. I  assume you could do the same thing and pass your profile params and then within the loaded offer utilise those params

adobe.target.getOffer({ "mbox": "target-global-mbox", "params": { "a": 1, "b": 2, "profile.age": 27, "profile.gender": "male" }, "success": function(offer) { adobe.target.applyOffer( { "mbox": "target-global-mbox", "offer": offer } ); }, "error": function(status, error) { console.log('Error', status, error); } });

 

1 reply

richardlee-1Accepted solution
Level 2
January 14, 2020

Hi @paul53181 

we sometimes trigger activities based click events etc using the getOffer() in the handler to retrieve the activity. I  assume you could do the same thing and pass your profile params and then within the loaded offer utilise those params

adobe.target.getOffer({ "mbox": "target-global-mbox", "params": { "a": 1, "b": 2, "profile.age": 27, "profile.gender": "male" }, "success": function(offer) { adobe.target.applyOffer( { "mbox": "target-global-mbox", "offer": offer } ); }, "error": function(status, error) { console.log('Error', status, error); } });