Package com.google.api.adwords.v201309.cm

Examples of com.google.api.adwords.v201309.cm.AdGroupCriterionPage


        new Predicate("CriteriaType", PredicateOperator.EQUALS, new String[] {"KEYWORD"});
    selector.setPredicates(new Predicate[] {adGroupIdPredicate, criteriaTypePredicate});

    while (morePages) {
      // Get all ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.get(selector);

      // Display ad group criteria.
      if (page.getEntries() != null && page.getEntries().length > 0) {
        // Display results.
        for (AdGroupCriterion adGroupCriterionResult : page.getEntries()) {
          System.out.println("Keyword ad group criterion with ad group id \""
              + adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
              + adGroupCriterionResult.getCriterion().getId() + "\", text \""
              + ((Keyword) adGroupCriterionResult.getCriterion()).getText()
              + "\" and match type \""
              + ((Keyword) adGroupCriterionResult.getCriterion()).getMatchType() + "\" was found.");
        }
      } else {
        System.out.println("No ad group criteria were found.");
      }

      offset += PAGE_SIZE;
      selector.getPaging().setStartIndex(offset);
      morePages = offset < page.getTotalNumEntries();
    }
  }
View Full Code Here


        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);

      // Display ad group criteria.
      if (page.getEntries() != null && page.getEntries().length > 0) {
        // Display results.
        for (AdGroupCriterion adGroupCriterionResult : page.getEntries()) {
          System.out.printf("Placement ad group criterion with ad group id \"%d\", "
              + "criterion id \"%d\" and url \"%s\" was found.\n",
              adGroupCriterionResult.getAdGroupId(), adGroupCriterionResult.getCriterion().getId(),
              ((Placement) adGroupCriterionResult.getCriterion()).getUrl());
        }
      } else {
        System.out.println("No ad group criteria were found.");
      }

      offset += PAGE_SIZE;
      selector.getPaging().setStartIndex(offset);
      morePages = offset < page.getTotalNumEntries();
    }
  }
View Full Code Here

        new Predicate("CriteriaType", PredicateOperator.EQUALS, new String[] {"KEYWORD"});
    selector.setPredicates(new Predicate[] {adGroupIdPredicate, criteriaTypePredicate});

    while (morePages) {
      // Get all ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.get(selector);

      // Display ad group criteria.
      if (page.getEntries() != null && page.getEntries().length > 0) {
        // Display results.
        for (AdGroupCriterion adGroupCriterionResult : page.getEntries()) {
          System.out.println("Keyword ad group criterion with ad group id \""
              + adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
              + adGroupCriterionResult.getCriterion().getId() + "\", text \""
              + ((Keyword) adGroupCriterionResult.getCriterion()).getText()
              + "\" and match type \""
              + ((Keyword) adGroupCriterionResult.getCriterion()).getMatchType() + "\" was found.");
        }
      } else {
        System.out.println("No ad group criteria were found.");
      }

      offset += PAGE_SIZE;
      selector.getPaging().setStartIndex(offset);
      morePages = offset < page.getTotalNumEntries();
    }
  }
View Full Code Here

        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);

      // Display ad group criteria.
      if (page.getEntries() != null && page.getEntries().length > 0) {
        // Display results.
        for (AdGroupCriterion adGroupCriterionResult : page.getEntries()) {
          System.out.printf("Placement ad group criterion with ad group id \"%d\", "
              + "criterion id \"%d\" and url \"%s\" was found.\n",
              adGroupCriterionResult.getAdGroupId(), adGroupCriterionResult.getCriterion().getId(),
              ((Placement) adGroupCriterionResult.getCriterion()).getUrl());
        }
      } else {
        System.out.println("No ad group criteria were found.");
      }

      offset += PAGE_SIZE;
      selector.getPaging().setStartIndex(offset);
      morePages = offset < page.getTotalNumEntries();
    }
  }
View Full Code Here

        .equals("CriteriaType", "KEYWORD")
        .build();

    while (morePages) {
      // Get all ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.get(selector);

      // Display ad group criteria.
      if (page.getEntries() != null && page.getEntries().length > 0) {
        // Display results.
        for (AdGroupCriterion adGroupCriterionResult : page.getEntries()) {
          System.out.println("Keyword ad group criterion with ad group id \""
              + adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
              + adGroupCriterionResult.getCriterion().getId() + "\", text \""
              + ((Keyword) adGroupCriterionResult.getCriterion()).getText()
              + "\" and match type \""
              + ((Keyword) adGroupCriterionResult.getCriterion()).getMatchType() + "\" was found.");
        }
      } else {
        System.out.println("No ad group criteria were found.");
      }

      offset += PAGE_SIZE;
      selector = builder.increaseOffsetBy(PAGE_SIZE).build();
      morePages = offset < page.getTotalNumEntries();
    }
  }
View Full Code Here

        .equals("CriteriaType", "KEYWORD")
        .build();

    while (morePages) {
      // Get all ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.get(selector);

      // Display ad group criteria.
      if (page.getEntries() != null && page.getEntries().length > 0) {
        // Display results.
        for (AdGroupCriterion adGroupCriterionResult : page.getEntries()) {
          System.out.println("Keyword ad group criterion with ad group id \""
              + adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
              + adGroupCriterionResult.getCriterion().getId() + "\", text \""
              + ((Keyword) adGroupCriterionResult.getCriterion()).getText()
              + "\" and match type \""
              + ((Keyword) adGroupCriterionResult.getCriterion()).getMatchType() + "\" was found.");
        }
      } else {
        System.out.println("No ad group criteria were found.");
      }

      offset += PAGE_SIZE;
      selector = builder.increaseOffsetBy(PAGE_SIZE).build();
      morePages = offset < page.getTotalNumEntries();
    }
  }
View Full Code Here

        new AdGroupCriterionIdFilter(null, adGroupId, null)});

    Map<Keyword, KeywordTraffic> keywordTrafficMap = new HashMap<Keyword, KeywordTraffic>();

    // Get all keywords for ad group.
    AdGroupCriterionPage page = adGroupCriterionService.get(selector);

    if (page.getEntries() != null) {
      for (AdGroupCriterion adGroupCriterion : page.getEntries()) {
        if (adGroupCriterion.getCriterion() instanceof Keyword) {
          keywordTrafficMap.put((Keyword) adGroupCriterion.getCriterion(), null);
        }
      }
View Full Code Here

    // Create DateRange.
    DateRange range = new DateRange(TestUtils.firstDayOfMonth(), TestUtils.today());
    selector.setStatsSelector(new StatsSelector(range, null));

    AdGroupCriterionPage page = service.get(selector);

    assertNotNull(page);
    assertEquals(new Integer(1), page.getTotalNumEntries());
    assertNotNull(((BiddableAdGroupCriterion) page.getEntries(0)).getStats());
  }
View Full Code Here

    // Create selector and filter.
    AdGroupCriterionSelector selector = new AdGroupCriterionSelector();
    AdGroupCriterionIdFilter idFilter = new AdGroupCriterionIdFilter(null, adGroupId, null);
    selector.setIdFilters(new AdGroupCriterionIdFilter[] {idFilter});

    AdGroupCriterionPage page = service.get(selector);

    assertNotNull(page);
    assertNotNull(page.getEntries());
    assertTrue("Expected at least 1 entry", page.getTotalNumEntries() >= 1);
  }
View Full Code Here

    // Create selector and filter.
    AdGroupCriterionSelector selector = new AdGroupCriterionSelector();
    AdGroupCriterionIdFilter idFilter = new AdGroupCriterionIdFilter(campaignId, null, null);
    selector.setIdFilters(new AdGroupCriterionIdFilter[] {idFilter});

    AdGroupCriterionPage page = service.get(selector);

    assertNotNull(page);
    assertNotNull(page.getEntries());
    assertTrue("Expected at least 1 entry", page.getTotalNumEntries() >= 1);
  }
View Full Code Here

TOP

Related Classes of com.google.api.adwords.v201309.cm.AdGroupCriterionPage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.