Package com.google.api.ads.adwords.axis.v201402.video

Examples of com.google.api.ads.adwords.axis.v201402.video.Topic


     *
     * @param criterion the criterion to add
     * @return the new operation
     */
    private AdGroupCriterionOperation createAddOperation(AdGroupCriterion criterion) {
      AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
      operation.setOperand(criterion);
      operation.setOperator(Operator.ADD);
      return operation;
    }
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

    AdGroupCriterionOperation ageRangeNegativeAdGroupCriterionOperation =
        new AdGroupCriterionOperation();
    ageRangeNegativeAdGroupCriterionOperation.setOperand(ageRangeNegativeAdGroupCriterion);
    ageRangeNegativeAdGroupCriterionOperation.setOperator(Operator.ADD);

    AdGroupCriterionReturnValue result =
        adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {
            genderAdGroupCriterionOperation, ageRangeNegativeAdGroupCriterionOperation});

    // Display campaigns.
    for (AdGroupCriterion adGroupCriterion : result.getValue()) {
      System.out.printf("AdGroup criterion with adGroup id '%s', criterion id '%s', "
          + "and type '%s' was added.\n", adGroupCriterion.getAdGroupId(),
          adGroupCriterion.getCriterion().getId(),
          adGroupCriterion.getCriterion().getCriterionType());
    }
View Full Code Here

  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId) throws Exception {
    // Get the AdGroupCriterionService.
    AdGroupCriterionServiceInterface adGroupCriterionService =
        adWordsServices.get(session, AdGroupCriterionServiceInterface.class);

    // https://developers.google.com/adwords/api/docs/appendix/genders
    Gender male = new Gender();
    male.setId(10L);
    BiddableAdGroupCriterion genderBiddableAdGroupCriterion = new BiddableAdGroupCriterion();
    genderBiddableAdGroupCriterion.setAdGroupId(adGroupId);
    genderBiddableAdGroupCriterion.setCriterion(male);

    // https://developers.google.com/adwords/api/docs/appendix/ages
    AgeRange undetermined = new AgeRange();
    undetermined.setId(503999L);
    NegativeAdGroupCriterion ageRangeNegativeAdGroupCriterion = new NegativeAdGroupCriterion();
    ageRangeNegativeAdGroupCriterion.setAdGroupId(adGroupId);
    ageRangeNegativeAdGroupCriterion.setCriterion(undetermined);

    AdGroupCriterionOperation genderAdGroupCriterionOperation = new AdGroupCriterionOperation();
    genderAdGroupCriterionOperation.setOperand(genderBiddableAdGroupCriterion);
    genderAdGroupCriterionOperation.setOperator(Operator.ADD);
    AdGroupCriterionOperation ageRangeNegativeAdGroupCriterionOperation =
        new AdGroupCriterionOperation();
    ageRangeNegativeAdGroupCriterionOperation.setOperand(ageRangeNegativeAdGroupCriterion);
    ageRangeNegativeAdGroupCriterionOperation.setOperator(Operator.ADD);

    AdGroupCriterionReturnValue result =
        adGroupCriterionService.mutate(new AdGroupCriterionOperation[] {
            genderAdGroupCriterionOperation, ageRangeNegativeAdGroupCriterionOperation});

    // Display campaigns.
    for (AdGroupCriterion adGroupCriterion : result.getValue()) {
      System.out.printf("AdGroup criterion with adGroup id '%s', criterion id '%s', "
View Full Code Here

  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId) throws Exception {
    // Get the AdGroupCriterionService.
    AdGroupCriterionServiceInterface adGroupCriterionService =
        adWordsServices.get(session, AdGroupCriterionServiceInterface.class);

    int offset = 0;
    boolean morePages = true;

    // Create selector.
    SelectorBuilder builder = new SelectorBuilder();
    Selector selector = builder
        .fields("Id", "AdGroupId", "MatchType", "KeywordText")
        .orderAscBy("AdGroupId")
        .offset(offset)
        .limit(PAGE_SIZE)
        .in("AdGroupId", adGroupId.toString())
        .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()) {
View Full Code Here

    bid2.setBid(new Money(null, 10000000L));
    biddingStrategyConfiguration2.setBids(new Bids[] {bid2});
    adGroup2.setBiddingStrategyConfiguration(biddingStrategyConfiguration2);

    // Create operations.
    AdGroupOperation operation = new AdGroupOperation();
    operation.setOperand(adGroup);
    operation.setOperator(Operator.ADD);
    AdGroupOperation operation2 = new AdGroupOperation();
    operation2.setOperand(adGroup2);
    operation2.setOperator(Operator.ADD);

    AdGroupOperation[] operations = new AdGroupOperation[] {operation, operation2};

    // Add ad groups.
    AdGroupReturnValue result = adGroupService.mutate(operations);
View Full Code Here

    AdGroup adGroup = new AdGroup();
    adGroup.setId(adGroupId);
    adGroup.setStatus(AdGroupStatus.DELETED);

    // Create operations.
    AdGroupOperation operation = new AdGroupOperation();
    operation.setOperand(adGroup);
    operation.setOperator(Operator.SET);

    AdGroupOperation[] operations = new AdGroupOperation[] {operation};

    // Delete ad group.
    AdGroupReturnValue result = adGroupService.mutate(operations);
View Full Code Here

    operation2.setOperator(Operator.ADD);

    AdGroupOperation[] operations = new AdGroupOperation[] {operation, operation2};

    // Add ad groups.
    AdGroupReturnValue result = adGroupService.mutate(operations);

    // Display new ad groups.
    for (AdGroup adGroupResult : result.getValue()) {
      System.out.println("Ad group with name \"" + adGroupResult.getName() + "\" and id \""
          + adGroupResult.getId() + "\" was added.");
    }
  }
View Full Code Here

    operation.setOperator(Operator.SET);

    AdGroupOperation[] operations = new AdGroupOperation[] {operation};

    // Delete ad group.
    AdGroupReturnValue result = adGroupService.mutate(operations);

    // Display ad groups.
    for (AdGroup adGroupResult : result.getValue()) {
      System.out.println("Ad group with name \"" + adGroupResult.getName() + "\" and id \""
          + adGroupResult.getId() + "\" was deleted.");
    }
  }
View Full Code Here

  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, long campaignId) throws Exception {
    // Get the AdGroupService.
    AdGroupServiceInterface adGroupService =
        adWordsServices.get(session, AdGroupServiceInterface.class);

    // Create ad group.
    AdGroup adGroup = new AdGroup();
    adGroup.setName("Earth to Mars Cruises #" + System.currentTimeMillis());
    adGroup.setStatus(AdGroupStatus.ENABLED);
    adGroup.setCampaignId(campaignId);

    // Optional settings.

    // Targeting restriction settings - these settings only affect serving
    // for the Display Network.
    TargetingSetting targeting = new TargetingSetting();
    TargetingSettingDetail placements = new TargetingSettingDetail();
    placements.setCriterionTypeGroup(CriterionTypeGroup.PLACEMENT);
    placements.setTargetAll(Boolean.TRUE);
    TargetingSettingDetail verticals = new TargetingSettingDetail();
    verticals.setCriterionTypeGroup(CriterionTypeGroup.VERTICAL);
    verticals.setTargetAll(Boolean.FALSE);
    targeting.setDetails(new TargetingSettingDetail[]{placements, verticals});

    // Create ad group bid.
    BiddingStrategyConfiguration biddingStrategyConfiguration = new BiddingStrategyConfiguration();
    CpcBid bid = new CpcBid();
    bid.setBid(new Money(null, 10000000L));
    biddingStrategyConfiguration.setBids(new Bids[] {bid});
    adGroup.setBiddingStrategyConfiguration(biddingStrategyConfiguration);

    // Add as many additional ad groups as you need.
    AdGroup adGroup2 = new AdGroup();
    adGroup2.setName("Earth to Venus Cruises #" + System.currentTimeMillis());
    adGroup2.setStatus(AdGroupStatus.ENABLED);
    adGroup2.setCampaignId(campaignId);

    BiddingStrategyConfiguration biddingStrategyConfiguration2 = new BiddingStrategyConfiguration();
    CpcBid bid2 = new CpcBid();
    bid2.setBid(new Money(null, 10000000L));
    biddingStrategyConfiguration2.setBids(new Bids[] {bid2});
    adGroup2.setBiddingStrategyConfiguration(biddingStrategyConfiguration2);

    // Create operations.
    AdGroupOperation operation = new AdGroupOperation();
    operation.setOperand(adGroup);
    operation.setOperator(Operator.ADD);
    AdGroupOperation operation2 = new AdGroupOperation();
    operation2.setOperand(adGroup2);
    operation2.setOperator(Operator.ADD);

    AdGroupOperation[] operations = new AdGroupOperation[] {operation, operation2};

    // Add ad groups.
    AdGroupReturnValue result = adGroupService.mutate(operations);

    // Display new ad groups.
    for (AdGroup adGroupResult : result.getValue()) {
      System.out.println("Ad group with name \"" + adGroupResult.getName() + "\" and id \""
          + adGroupResult.getId() + "\" was added.");
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.v201402.video.Topic

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.