Package com.google.api.adwords.v201306.cm

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


    operation.setOperator(Operator.SET);

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

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

    // Display ad group criteria.
    for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
      if (adGroupCriterionResult instanceof BiddableAdGroupCriterion) {
        biddableAdGroupCriterion = (BiddableAdGroupCriterion) adGroupCriterionResult;
        System.out.println(
            "Ad group criterion with ad group id \""
                + biddableAdGroupCriterion.getAdGroupId() + "\", criterion id \""
View Full Code Here


    AdGroupCriterionOperation[] operations =
        new AdGroupCriterionOperation[] {keywordAdGroupCriterionOperation1,
            keywordAdGroupCriterionOperation2};

    // Add keywords.
    AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);

    // Display results.
    for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
      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 added.");
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.
    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.
    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());
      }
    }

    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

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

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

    // Display results.
    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 placement '%s' was added.\n", adGroupCriterionResult.getAdGroupId(),
            adGroupCriterionResult.getCriterion().getId(),
            ((Placement) adGroupCriterionResult.getCriterion()).getUrl());
      }
    }

    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' "
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.
    for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
      if (adGroupCriterionResult instanceof BiddableAdGroupCriterion) {
        biddableAdGroupCriterion = (BiddableAdGroupCriterion) adGroupCriterionResult;
        System.out.println("Ad group criterion with ad group id \""
            + biddableAdGroupCriterion.getAdGroupId()
            + "\", criterion id \""
View Full Code Here

    AdGroupCriterionOperation[] operations =
        new AdGroupCriterionOperation[] {placementAdGroupCriterionOperation1,
            placementAdGroupCriterionOperation2};

    // Add placements.
    AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);

    // Display results.
    for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
      System.out.printf(
          "Placement ad group criterion with ad group id \"%d\", criterion id \"%d\" "
              + "and url \"%s\" was added.", adGroupCriterionResult.getAdGroupId(),
          adGroupCriterionResult.getCriterion().getId(),
          ((Placement) adGroupCriterionResult.getCriterion()).getUrl());
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.
    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

    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

    ProductBiddingCategory otherBiddingCategory = new ProductBiddingCategory();
    otherBiddingCategory.setType(ProductDimensionType.BIDDING_CATEGORY_L1);
    helper.createUnit(otherBrand, otherBiddingCategory, 110000L);

    // Make the mutate request.
    AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(helper.getOperations());

    // For each criterion, make a list containing each of its children.
    // We always create the parent before the child, so we can rely on that here.
    Map<Long, List<ProductPartition>> children = Maps.newHashMap();
    ProductPartition rootNode = null;
    for (AdGroupCriterion adGroupCriterion : result.getValue()) {
      children.put(adGroupCriterion.getCriterion().getId(), Lists.<ProductPartition>newArrayList());

      if (!(adGroupCriterion.getCriterion() instanceof ProductPartition)) {
        throw new IllegalStateException("Expected criterion of ProductPartition but found "
            + adGroupCriterion.getCriterion() + ".");
View Full Code Here

TOP

Related Classes of com.google.api.adwords.v201306.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.