// Get AdWordsUser from "~/adwords.properties".
AdWordsUser user = new AdWordsUser();
// Get the AdGroupCriterionService.
AdGroupCriterionServiceInterface adGroupCriterionService =
user.getService(AdWordsService.V201306.ADGROUP_CRITERION_SERVICE);
Long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");
// Create selector.
Selector selector = new Selector();
selector.setFields(new String[] {"Id", "AdGroupId", "Status"});
selector.setOrdering(new OrderBy[] {new OrderBy("Id", SortOrder.ASCENDING)});
// Create predicates.
Predicate statusPredicate =
new Predicate("Status", PredicateOperator.IN, new String[] {"ACTIVE"});
Predicate adGroupIdPredicate =
new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
selector.setPredicates(new Predicate[] {statusPredicate, adGroupIdPredicate});
// Get all active ad group criteria.
AdGroupCriterionPage page = adGroupCriterionService.get(selector);
// Display ad group criteria.
if (page.getEntries() != null && page.getEntries().length > 0) {
for (AdGroupCriterion adGroupCriterion : page.getEntries()) {
if (adGroupCriterion instanceof BiddableAdGroupCriterion) {