selector.setFields(new String[] {"Id", "AdGroupId", "PlacementUrl"});
selector.setOrdering(new OrderBy[] {new OrderBy("AdGroupId", SortOrder.ASCENDING)});
selector.setPaging(new Paging(offset, PAGE_SIZE));
// Create predicates.
Predicate adGroupIdPredicate =
new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
Predicate criteriaTypePredicate =
new Predicate("CriteriaType", PredicateOperator.EQUALS, new String[] {"PLACEMENT"});
selector.setPredicates(new Predicate[] {adGroupIdPredicate, criteriaTypePredicate});
while (morePages) {
// Get all ad group criteria.
AdGroupCriterionPage page = adGroupCriterionService.get(selector);