Ad Set to Custom Audience Mapping in Paid Media Manager

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:

  1. Does Pega expect an Ad Set to contain exactly one Custom Audience?
  2. If an Ad Set contains multiple Custom Audiences, how does Pega determine which audience to return?
  3. Does the implementation simply select the first element (custom_audiences[0])?
  4. Or does Pega apply additional logic to identify the appropriate Pega Paid Media Audience?
  5. Is there any mapping maintained in Data-PaidMediaAudience between the Facebook Ad Set ID and the Pega Paid Media Audience?
  6. 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 CustomerID and AdsetID?
  7. 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.