Hi Team,
We are investigating how Pega Paid Media Manager resolves a Facebook Ad Set ID to a Custom Audience when processing paid-media interactions.
We found the following Java code in the Pega implementation:
String accountType = tools.getParamValue("AccountType");
String adSetId = tools.getParamValue("AdsetID");
com.pega.mkt.paidmedia.AccountSetting accountSettings = null;
com.pega.mkt.paidmedia.TargetSystem targetSystem = null;
if (com.pega.mkt.paidmedia.TargetSystem.Facebook.name().equals(accountType)) {
accountSettings = new com.pega.mkt.paidmedia.facebook.FacebookAccountSettings(myStepPage);
targetSystem = com.pega.mkt.paidmedia.TargetSystem.Facebook;
}
else if (com.pega.mkt.paidmedia.TargetSystem.Google.name().equals(accountType)){
accountSettings = new com.pega.mkt.paidmedia.google.GoogleAccountSettings(myStepPage);
targetSystem = com.pega.mkt.paidmedia.TargetSystem.Google;
}
java.util.Map<String,String> audienceMap = null;
try {
audienceMap = com.pega.mkt.paidmedia.CommonAdsUtilities
.getCustomAudienceMapByAdSetId(
adSetId,
accountSettings,
targetSystem
);
} catch(Throwable t) {
oLog.error(
String.format(
"Error while retriving the audience id with adsetid %s and account type %s",
adSetId,
accountType
),
t
);
}
if(audienceMap != null){
audienceID = audienceMap.get("id");
audienceName = audienceMap.get("name");
}
The method getCustomAudienceMapByAdSetId() appears to resolve an AdsetID to a Custom Audience.
Observed Facebook API Response
For one of our Facebook Ad Sets, querying the Meta Graph API using:
/{ad-set-id}?fields=id,name,targeting
returns:
{
"id": "12025xxxxxxxxxxxx",
"name": "xxxxxxxxxxxx",
"targeting": {
"custom_audiences": [
{
"id": "12025xxxxxxxxx",
"name": "Pxxxxxxxxx"
}
]
}
}
The important point is that Facebook represents custom_audiences as an array/list.
Question
We need clarification on how Pega’s CommonAdsUtilities.getCustomAudienceMapByAdSetId() handles this list.
Specifically:
- Does Pega expect an Ad Set to contain exactly one Custom Audience?
- If an Ad Set contains multiple Custom Audiences, how does Pega determine which audience to return?
- Does the implementation simply select the first element (
custom_audiences[0])? - Or does Pega apply additional logic to identify the appropriate Pega Paid Media Audience?
- Is there any mapping maintained in
Data-PaidMediaAudiencebetween the Facebook Ad Set ID and the Pega Paid Media Audience? - If multiple Pega audiences/offers are associated with the same Facebook Ad Set, how is the correct audience/offer identified when the interaction contains only
CustomerIDandAdsetID? - Is the supported Pega model strictly one Ad Set → one Custom Audience, even though Meta technically supports multiple Custom Audiences within an Ad Set?
We would also appreciate confirmation of the recommended configuration if multiple NBA Paid Media Audiences/offers need to be targeted through Facebook.