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