@asn_india
To confirm the use case -
- We want to create the audience in Adobe Target using the Audience API, this is the key value pair, i.e premierUser = true, correct?
- We want to use this audience as a segment in an experience in Target.
- At run time, when user visits the site and we call the third party service to obtain this flag value, we want to pass it to Target so that it can decide if to show the experience to the user. i.e if premierUser=true then user will qualify for Adobe Target experience with special offer.
If this is the case, then you have multiple functions available to pass in the key value pair as a parameter.
If we can get the flag prior to the global mbox being called, remember this will be picked up with the global mbox call automatically, the data would go under params;
targetPageParams = function() {
return {
"a": 1,
"premierUser": "true",
"profile": {
"age": 26,
"country": {
"city": "San Francisco"
}
}
};
};
If the data is not available in a timely manner or before the global mbox call then recommend making a custom mbox call using getOffer() & applyOffer(). We would want to pass in the value in the getOffer() function. The key value pair from the third party service would go under params;
adobe.target.getOffer({
"mbox": "target-global-mbox",
"params": {
"a": 1,
"b": 2,
"premierUser": "true",
"profile.gender": "male"
},
"success": function(offer) {
adobe.target.applyOffer( {
"mbox": "target-global-mbox",
"offer": offer
} );
},
"error": function(status, error) {
console.log('Error', status, error);
}
});
Here is a good article on using data providers which is also a option but means we hold up calling Target until we get a response from the data provider.
https://experienceleague.adobe.com/docs/target-learn/tutorials/integrations/use-data-providers-to-in...
Hope this helps!