Target DataProvider and regional mbox?

Avatar

Avatar
Boost 3
Level 1
THE_DK
Level 1

Likes

3 likes

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Boost 1
View profile

Avatar
Boost 3
Level 1
THE_DK
Level 1

Likes

3 likes

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Boost 1
View profile
THE_DK
Level 1

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

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 3
TanviAgarwal89
Level 3

Likes

30 likes

Total Posts

33 posts

Correct reply

18 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile

Avatar
Boost 5
Level 3
TanviAgarwal89
Level 3

Likes

30 likes

Total Posts

33 posts

Correct reply

18 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
TanviAgarwal89
Level 3

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/...

 

Answers (2)

Answers (2)

Avatar

Avatar
Contributor
Level 7
Eric_Vidana
Level 7

Likes

157 likes

Total Posts

151 posts

Correct reply

37 solutions
Top badges earned
Contributor
Shape 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Contributor
Level 7
Eric_Vidana
Level 7

Likes

157 likes

Total Posts

151 posts

Correct reply

37 solutions
Top badges earned
Contributor
Shape 1
Give Back 5
Give Back 3
Give Back 25
View profile
Eric_Vidana
Level 7

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
Boost 5
Level 2
skand
Level 2

Likes

9 likes

Total Posts

8 posts

Correct reply

2 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Boost 5
Level 2
skand
Level 2

Likes

9 likes

Total Posts

8 posts

Correct reply

2 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile
skand
Level 2

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