I need to call a 3rd part service in coordination with an Activity. I am looking at DataProviders. How to tell Target (at.js) which mbox depends on the data provider? That is, if I have 3 mbox, regional not global, on a particular web page and I need only one of these mbox to depend on the data provider, is this possible? Every example I find so far sets the data providers on targetGlobalSettings only for the global mbox, but can a data provider be passed to getOffers()?
Solved! Go to Solution.
Hi @THE_DK
You can refer the examples here to pass the third party information as mbox parameter
And
This to fetch the activity content for all the mboxes on the page
Seems like you are using AT 2.x so you should be able to pass an optional 3rd param into getOffers with the parameters (profile or mbox) that you need for that single call. You would need to call your data provider prior to running the code below and pass some vars around.
adobe.target.getOffers({ request: { execute: { mboxes: [ { index: 0, name: "first-mbox" }, { index: 1, name: "second-mbox", parameters: { a: 1 }, profileParameters: { b: 2 } } ] } } });
Hi @THE_DK
You can refer the examples here to pass the third party information as mbox parameter
And
This to fetch the activity content for all the mboxes on the page
Yes, all three right on that account! I was reading this though
which has a way to abstract this out a bit and let AT make the third party call in a timely way without custom code. But it appears to only work with global mbox. Maybe it is the nature of regional mbox though that eschews this data provider abstraction?
Views
Replies
Total Likes
I agree with @Eric_Vidana that you need call your Datasource before executing GetOffer() and How you call GetOffer() depends on What data you are going get and what are you going to use it for ?
For Example :
If on your site, a dynamic view will load based on the data coming from your data source then you can choose the selector of that view and make your getoffer() exceute when that view loads.
Above is just a random example for a SPA, I would appreciate if you can share your use case in detail.
Regards,
Skand
Views
Like
Replies