// Get AdWordsUser from "~/adwords.properties".
AdWordsUser user = new AdWordsUser();
// Get the AdGroupCriterionService.
AdGroupCriterionServiceInterface adGroupCriterionService =
user.getService(AdWordsService.V201309.ADGROUP_CRITERION_SERVICE);
Long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");
String query = String.format(
"SELECT Id, AdGroupId, Status WHERE AdGroupId = %d AND Status = ACTIVE ORDER BY Id ",
adGroupId);
// Get all active ad group criteria.
AdGroupCriterionPage page = adGroupCriterionService.query(query);
// Display ad group criteria.
if (page.getEntries() != null && page.getEntries().length > 0) {
for (AdGroupCriterion adGroupCriterion : page.getEntries()) {
if (adGroupCriterion instanceof BiddableAdGroupCriterion) {