How to get the List of Adgroups connected to a Audience(UserList) in Adwords API?

15 views
Skip to first unread message

Anurag Sinha

unread,
Sep 15, 2021, 5:46:13 AM9/15/21
to AdWords API and Google Ads API Forum
Hi Team,
How to get the list of AdGroups the Audience is connected to? We can get the reverse thing ie the List of Audience(UserList) connected to a AdGroups using below Adwords API.

AdGroupCriterionPage adGroupCriterionPage = adGroupCriterionService.get(
            new SelectorBuilder()
            .fields("AdGroupId","UserListId")
          .equals("CriteriaType",CriterionType._USER_LIST)
                    .equals("AdGroupId","624760644934")
            .build());
 if(adGroupCriterionPage.getEntries()!=null){
      for (AdGroupCriterion adGroupCriterionList : adGroupCriterionPage.getEntries()) {
        CriterionUserList criterionUserList = (CriterionUserList)adGroupCriterionList.getCriterion();
        System.out.printf("AdGroup id: %d, UserListId: %s",
                adGroupCriterionList.getAdGroupId(),
                criterionUserList.getUserListId());
        System.out.println();

      }
    }


Regards,
Anurag Sinha

Google Ads API Forum Advisor

unread,
Sep 16, 2021, 2:08:42 AM9/16/21
to anuragku...@in.pega.com, adwor...@googlegroups.com

Hello Anurag,

Thank you for reaching out to us.

The easiest way to get the list of AdGroups that the Audience is connected to is via Reports and utilize the AUDIENCE_PERFORMANCE_REPORT. From that report, you can use the Criteria field (which refers to the Audience) and the segment field (AdGroupId).

As an aside, please note that the AdWords API is deprecated and will be sunset on April 27, 2022. We strongly recommend that you migrate to the Google Ads API as soon as possible.

Regards,

Google Logo
Mark Kevin Albios
Google Ads API Team
 


ref:_00D1U1174p._5004Q2NUIPL:ref
Reply all
Reply to author
Forward
0 new messages