Target DataProvider and regional mbox?

Avatar

Avatar

THE_DK

Avatar

THE_DK

THE_DK

15-05-2020

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()?

Accepted Solutions (0)

Answers (3)

Answers (3)

Avatar

Avatar

Eric_Vidana

Avatar

Eric_Vidana

Eric_Vidana

18-05-2020

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
          }
        }
      ]
    }
  }
});

 

Avatar

Avatar

skand

Avatar

skand

skand

20-05-2020

@THE_DK 

 

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

Avatar

Avatar

TanviAgarwal89

Avatar

TanviAgarwal89

TanviAgarwal89

20-05-2020

Hi @THE_DK 

 

You can refer the examples here to pass the third party information as mbox parameter

https://docs.adobe.com/content/help/en/target/using/implement-target/client-side/functions-overview/...

 

And 

 

This to fetch the activity content for all the mboxes on the page

https://docs.adobe.com/content/help/en/target/using/implement-target/client-side/functions-overview/...