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

Examples of com.google.api.ads.adwords.axis.v201309.cm.AdGroupCriterion


    // Create base class criterion to avoid setting placement specific fields.
    Criterion criterion = new Placement();
    criterion.setId(criterionId);

    // Create ad group criterion.
    AdGroupCriterion adGroupCriterion = new AdGroupCriterion();
    adGroupCriterion.setAdGroupId(adGroupId);
    adGroupCriterion.setCriterion(criterion);

    // Create operations.
    AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
    operation.setOperand(adGroupCriterion);
    operation.setOperator(Operator.REMOVE);
View Full Code Here


    for (ApiError apiError : result.getPartialFailureErrors()) {
      Matcher matcher = operationIndexPattern.matcher(apiError.getFieldPath());
      if (matcher.matches()) {
        int operationIndex = Integer.parseInt(matcher.group(1));
        AdGroupCriterion adGroupCriterion = operations.get(operationIndex).getOperand();
        System.out.printf("Ad group criterion with ad group id '%d' and keyword '%s' "
            + "triggered a failure for the following reason: '%s'.\n",
            adGroupCriterion.getAdGroupId(),
            ((Keyword) adGroupCriterion.getCriterion()).getText(), apiError.getErrorString());
      } else {
        System.out.printf("A failure for the following reason: '%s' has occurred.\n",
            apiError.getErrorString());
      }
    }
View Full Code Here

    for (ApiError apiError : result.getPartialFailureErrors()) {
      Matcher matcher = operationIndexPattern.matcher(apiError.getFieldPath());
      if (matcher.matches()) {
        int operationIndex = Integer.parseInt(matcher.group(1));
        AdGroupCriterion adGroupCriterion = operations.get(operationIndex).getOperand();
        System.out.printf("Ad group criterion with ad group id '%d' and placement '%s' "
            + "triggered a failure for the following reason: '%s'.\n",
            adGroupCriterion.getAdGroupId(),
            ((Placement) adGroupCriterion.getCriterion()).getUrl(), apiError.getErrorString());
      } else {
        System.out.printf("A failure for the following reason: '%s' has occurred.\n",
            apiError.getErrorString());
      }
    }
View Full Code Here

    // Create base class criterion to avoid setting keyword specific fields.
    Criterion criterion = new Criterion();
    criterion.setId(criterionId);

    // Create ad group criterion.
    AdGroupCriterion adGroupCriterion = new AdGroupCriterion();
    adGroupCriterion.setAdGroupId(adGroupId);
    adGroupCriterion.setCriterion(criterion);

    // Create operations.
    AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
    operation.setOperand(adGroupCriterion);
    operation.setOperator(Operator.REMOVE);
View Full Code Here

        appStore});

    clickToDownloadAppAd.setTemplateElements(new TemplateElement[] {adData});

    // Create the AdGroupAd.
    AdGroupAd clickToDownloadAppAdGroupAd = new AdGroupAd();
    clickToDownloadAppAdGroupAd.setAdGroupId(adGroupId);
    clickToDownloadAppAdGroupAd.setAd(clickToDownloadAppAd);

    // Optional: Set the status.
    clickToDownloadAppAdGroupAd.setStatus(AdGroupAdStatus.PAUSED);

    // Create the operation.
    AdGroupAdOperation operation = new AdGroupAdOperation();
    operation.setOperator(Operator.ADD);
    operation.setOperand(clickToDownloadAppAdGroupAd);
View Full Code Here

    // Optional: Set the status.
    clickToDownloadAppAdGroupAd.setStatus(AdGroupAdStatus.PAUSED);

    // Create the operation.
    AdGroupAdOperation operation = new AdGroupAdOperation();
    operation.setOperator(Operator.ADD);
    operation.setOperand(clickToDownloadAppAdGroupAd);

    // Create the ads.
    AdGroupAdReturnValue result = adGroupAdService.mutate(new AdGroupAdOperation[] {operation});

    for (AdGroupAd adGroupAd : result.getValue()) {
View Full Code Here

    AdGroupAdOperation operation = new AdGroupAdOperation();
    operation.setOperator(Operator.ADD);
    operation.setOperand(clickToDownloadAppAdGroupAd);

    // Create the ads.
    AdGroupAdReturnValue result = adGroupAdService.mutate(new AdGroupAdOperation[] {operation});

    for (AdGroupAd adGroupAd : result.getValue()) {
      System.out.printf("New click-to-download ad with id = \"%d\" and url = \"%s\" " +
          "was created.", adGroupAd.getAd().getId(), adGroupAd.getAd().getUrl());
    }
  }
View Full Code Here

  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, long adGroupId) throws Exception {
    // Get the AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create the template ad.
    TemplateAd clickToDownloadAppAd = new TemplateAd();
    clickToDownloadAppAd.setName("Ad for jupiter adventure game");
    clickToDownloadAppAd.setTemplateId(353L);

    clickToDownloadAppAd.setUrl(
        "http://play.google.com/store/apps/details?id=com.example.jupiteradventure");
    clickToDownloadAppAd.setDisplayUrl("play.google.com");

    // Create the template elements for the ad. You can refer to
    // https://developers.google.com/adwords/api/docs/appendix/templateads
    // for the list of available template fields.
    TemplateElementField headline = new TemplateElementField();
    headline.setName("headline");
    headline.setFieldText("Enjoy a Jupiter Adventure");
    headline.setType(TemplateElementFieldType.TEXT);

    TemplateElementField description1 = new TemplateElementField();
    description1.setName("description1");
    description1.setFieldText("Realistic physics simulation");
    description1.setType(TemplateElementFieldType.TEXT);

    TemplateElementField description2 = new TemplateElementField();
    description2.setName("description2");
    description2.setFieldText("Race against players online");
    description2.setType(TemplateElementFieldType.TEXT);

    TemplateElementField appId = new TemplateElementField();
    appId.setName("appId");
    appId.setFieldText("com.example.jupiteradventure");
    appId.setType(TemplateElementFieldType.TEXT);

    TemplateElementField appStore = new TemplateElementField();
    appStore.setName("appStore");
    appStore.setFieldText("2");
    appStore.setType(TemplateElementFieldType.ENUM);

    TemplateElement adData = new TemplateElement();
    adData.setUniqueName("adData");
    adData.setFields(new TemplateElementField[] {headline, description1, description2, appId,
        appStore});

    clickToDownloadAppAd.setTemplateElements(new TemplateElement[] {adData});

    // Create the AdGroupAd.
    AdGroupAd clickToDownloadAppAdGroupAd = new AdGroupAd();
    clickToDownloadAppAdGroupAd.setAdGroupId(adGroupId);
    clickToDownloadAppAdGroupAd.setAd(clickToDownloadAppAd);

    // Optional: Set the status.
    clickToDownloadAppAdGroupAd.setStatus(AdGroupAdStatus.PAUSED);

    // Create the operation.
    AdGroupAdOperation operation = new AdGroupAdOperation();
    operation.setOperator(Operator.ADD);
    operation.setOperand(clickToDownloadAppAdGroupAd);

    // Create the ads.
    AdGroupAdReturnValue result = adGroupAdService.mutate(new AdGroupAdOperation[] {operation});

    for (AdGroupAd adGroupAd : result.getValue()) {
      System.out.printf("New click-to-download ad with id = \"%d\" and url = \"%s\" " +
          "was created.", adGroupAd.getAd().getId(), adGroupAd.getAd().getUrl());
    }
View Full Code Here

    // Create mobile platform. The ID can be found in the documentation.
    // https://developers.google.com/adwords/api/docs/appendix/platforms
    Platform mobile = new Platform();
    mobile.setId(30001L);

    AdGroupBidModifier adGroupBidModifier = new AdGroupBidModifier();
    adGroupBidModifier.setAdGroupId(adGroupId);
    adGroupBidModifier.setBidModifier(BID_MODIFIER);
    adGroupBidModifier.setCriterion(mobile);

    // Create ADD operation.
    AdGroupBidModifierOperation operation = new AdGroupBidModifierOperation();
    operation.setOperand(adGroupBidModifier);
    // Use 'ADD' to add a new modifier and 'SET' to update an existing one. A
View Full Code Here

    adGroupBidModifier.setAdGroupId(adGroupId);
    adGroupBidModifier.setBidModifier(BID_MODIFIER);
    adGroupBidModifier.setCriterion(mobile);

    // Create ADD operation.
    AdGroupBidModifierOperation operation = new AdGroupBidModifierOperation();
    operation.setOperand(adGroupBidModifier);
    // Use 'ADD' to add a new modifier and 'SET' to update an existing one. A
    // modifier can be removed with the 'REMOVE' operator.
    operation.setOperator(Operator.ADD);

    // Update ad group bid modifier.
    AdGroupBidModifierReturnValue result =
        adGroupBidModifierService.mutate(new AdGroupBidModifierOperation[] {operation});
    for (AdGroupBidModifier bidModifierResult : result.getValue()) {
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.v201309.cm.AdGroupCriterion

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.