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

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


    AdGroupCriterionOperation[] operations =
        new AdGroupCriterionOperation[] {keywordAdGroupCriterionOperation};

    // Add ad group criteria.
    AdGroupCriterionReturnValue result = service.mutate(operations);
    BiddableAdGroupCriterion testCriterion = (BiddableAdGroupCriterion) result.getValue()[0];

    // Exclude generated fields.
    criterion.getCriterion().setId(testCriterion.getCriterion().getId());
    criterion.getCriterion().setCriterionType(testCriterion.getCriterion().getCriterionType());
    criterion.setSystemServingStatus(testCriterion.getSystemServingStatus());
View Full Code Here


    operation.setOperator(Operator.ADD);

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

    // Add ad group criteria.
    AdGroupCriterionReturnValue result = service.mutate(operations);
    NegativeAdGroupCriterion testCriterion = (NegativeAdGroupCriterion) result.getValue()[0];

    // Exclude generated fields.
    criterion.getCriterion().setId(testCriterion.getCriterion().getId());
    criterion.getCriterion().setCriterionType(testCriterion.getCriterion().getCriterionType());
    criterion.setAdGroupCriterionType(testCriterion.getAdGroupCriterionType());
View Full Code Here

    operation.setOperator(Operator.SET);

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

    // Update ad group criteria.
    AdGroupCriterionReturnValue result = service.mutate(operations);
    BiddableAdGroupCriterion testCriterion = (BiddableAdGroupCriterion) result.getValue()[0];

    assertEquals(criterion.getUserStatus(), testCriterion.getUserStatus());
  }
View Full Code Here

    operation.setOperator(Operator.SET);

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

    // Update ad group criteria.
    AdGroupCriterionReturnValue result = service.mutate(operations);
    BiddableAdGroupCriterion testCriterion = (BiddableAdGroupCriterion) result.getValue()[0];

    assertEquals(criterion.getCriterion().getId(), testCriterion.getCriterion().getId());
  }
View Full Code Here

      operation.setOperator(Operator.REMOVE);

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

      // Delete ad group criteria.
      AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);

      // Display ad group criteria.
      if (result != null && result.getValue() != null) {
        for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
          System.out.println("Ad group criterion with ad group id \""
              + adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
              + adGroupCriterionResult.getCriterion().getId() + "\", and type \""
              + adGroupCriterionResult.getCriterion().getCriterionType() + "\" was deleted.");
        }
View Full Code Here

        keywordAdGroupCriterionOperation.setOperator(Operator.ADD);
        operations.add(keywordAdGroupCriterionOperation);
      }

      // Add ad group criteria.
      AdGroupCriterionReturnValue result =
          adGroupCriterionService.mutate(operations.toArray(new AdGroupCriterionOperation[] {}));

      // Display results.
      if ((result != null) && (result.getValue() != null)) {
        for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
          if (adGroupCriterionResult.getCriterion() != null) {
            System.out.printf("Ad group criterion with ad group id '%d', and criterion id '%d', "
                + "and keyword '%s' was added.\n", adGroupCriterionResult.getAdGroupId(),
                adGroupCriterionResult.getCriterion().getId(),
                ((Keyword) adGroupCriterionResult.getCriterion()).getText());
          }
        }
      } else {
        System.out.println("No ad group criteria were added.");
      }

      if ((result != null) && (result.getPartialFailureErrors() != null)) {
        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' "
View Full Code Here

      AdGroupCriterionOperation[] operations =
          new AdGroupCriterionOperation[] {keywordAdGroupCriterionOperation,
              placementAdGroupCriterionOperation};

      // Add ad group criteria.
      AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);

      // Display ad group criteria.
      if (result != null && result.getValue() != null) {
        for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
          System.out.println("Ad group criterion with ad group id \""
              + adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
              + adGroupCriterionResult.getCriterion().getId() + "\", and type \""
              + adGroupCriterionResult.getCriterion().getCriterionType() + "\" was added.");
        }
View Full Code Here

      AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] {
          genderBiddableAdGroupCriterionOperation, ageRangeNegativeAdGroupCriterionOperation};

      // Add ad group criteria.
      AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);

      // Display ad group criteria.
      if (result != null && result.getValue() != null) {
        for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
          System.out.println("Ad group criterion with ad group id \""
              + adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
              + adGroupCriterionResult.getCriterion().getId() + "\", and type \""
              + adGroupCriterionResult.getCriterion().getCriterionType() + "\" was added.");
        }
View Full Code Here

      operation.setOperator(Operator.SET);

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

      // Update ad group criteria.
      AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);

      // Display ad group criteria.
      if (result != null && result.getValue() != null) {
        for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
          if (adGroupCriterionResult instanceof BiddableAdGroupCriterion) {
            biddableAdGroupCriterion = (BiddableAdGroupCriterion) adGroupCriterionResult;
            CpcBid bid =
                (CpcBid) biddableAdGroupCriterion.getBiddingStrategyConfiguration().getBids(0);
            System.out.println("Ad group criterion with ad group id \""
View Full Code Here

      AdGroupCriterionOperation[] operations =
          new AdGroupCriterionOperation[] {placementAdGroupCriterionOperation};

      // Add ad group criteria.
      AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);

      // Display ad group criteria.
      if (result != null && result.getValue() != null) {
        for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
          System.out.println("Ad group criterion with ad group id \""
              + adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
              + adGroupCriterionResult.getCriterion().getId() + "\", and type \""
              + adGroupCriterionResult.getCriterion().getCriterionType() + "\" was added.");
        }
View Full Code Here

TOP

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

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.