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

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


      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;
            System.out.println("Ad group criterion with ad group id \""
                + biddableAdGroupCriterion.getAdGroupId() + "\", criterion id \""
                + biddableAdGroupCriterion.getCriterion().getId() + "\", type \""
View Full Code Here


      String query = String.format(
          "SELECT Id, AdGroupId, Status WHERE AdGroupId = %d AND Status = ACTIVE ORDER BY Id ",
          adGroupId);

      // Get all active ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.query(query);

      // Display ad group criteria.
      if (page.getEntries() != null && page.getEntries().length > 0) {
        for (AdGroupCriterion adGroupCriterion : page.getEntries()) {
          if (adGroupCriterion instanceof BiddableAdGroupCriterion) {
            BiddableAdGroupCriterion biddableAdGroupCriterion =
                (BiddableAdGroupCriterion) adGroupCriterion;
            System.out.println("Ad group criterion with ad group id \""
                + biddableAdGroupCriterion.getAdGroupId() + "\", criterion id \""
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

      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;
            System.out.println("Ad group criterion with ad group id \""
                + biddableAdGroupCriterion.getAdGroupId() + "\", criterion id \""
                + biddableAdGroupCriterion.getCriterion().getId() + "\", type \""
View Full Code Here

      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the AdGroupCriterionService.
      AdGroupCriterionServiceInterface adGroupCriterionService =
          user.getService(AdWordsService.V201309.ADGROUP_CRITERION_SERVICE);

      Long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");

      String query = String.format(
          "SELECT Id, AdGroupId, Status WHERE AdGroupId = %d AND Status = ACTIVE ORDER BY Id ",
          adGroupId);

      // Get all active ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.query(query);

      // Display ad group criteria.
      if (page.getEntries() != null && page.getEntries().length > 0) {
        for (AdGroupCriterion adGroupCriterion : page.getEntries()) {
          if (adGroupCriterion instanceof BiddableAdGroupCriterion) {
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.