AdGroupCriterionPage query not giving existing age ranges, income ranges and genders

25 views
Skip to first unread message

Chaitanya Kulkarni

unread,
Aug 19, 2019, 6:50:22 AM8/19/19
to AdWords API and Google Ads API Forum

Hi Team,


while creating a new search campaign using adwords APIs, values for Age Range, Income Range and Genders are added by default. All the options are enabled by default. But when I try to get the existing values using the PageQueries, these values are not getting reflected in the response. I always get null values.


Following is the code.


====

String query = "SELECT Id, IncomeRangeType WHERE AdGroupId = " + adGroupId

+ " AND CriteriaType = 'INCOME_RANGE' AND CriterionUse != 'NEGATIVE' ORDER BY Id";


AdGroupCriterionPage page = null;

int offset = 0;


do {

String pageQuery = query + String.format(" LIMIT %d, %d", offset, PAGE_SIZE);


page = adGroupCriterionService.query(pageQuery);


if (page.getEntries() != null) {

for (AdGroupCriterion adGroupCriterionResult : page.getEntries()) {

IncomeRange incomeRange = (IncomeRange) adGroupCriterionResult.getCriterion();

AdwordsIncomeRange adwordsIncomeRange = new AdwordsIncomeRange(incomeRange);

adGroupIncomeRangeList.add(adwordsIncomeRange);

}

}

offset += PAGE_SIZE;

} while (offset < page.getTotalNumEntries());


return adGroupIncomeRangeList;

=====


But when I make some changes in the ages range, income range and gender values through AdWords UI, the above query works perfectly fine and provides me the enabled/active ages ranges.


Could you please let me know if there is any specific query param I need to get the default enabled/eligible age ranges, income ranges and genders?


Thanks,

Chaitanya

Google Ads API Forum Advisor Prod

unread,
Aug 20, 2019, 2:14:01 AM8/20/19
to adwor...@googlegroups.com
Hi Chaitanya,

Thank you for reaching out.

In the API perspective, if you did not explicitly target a specific criteria in your ad group during creation, it will not be returned when you try to get it using the AdGroupCriterionService. It does not return the default enabled criteria.

Let me know if you have further clarifications.

Regards,
Dannison
Google Ads API Team

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