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

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


    // 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


    // 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

    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

      if (parent != null) {
        unit.setParentCriterionId(parent.getId());
        unit.setCaseValue(value);
      }

      AdGroupCriterion criterion;
      if (bidAmount != null && bidAmount > 0) {
        BiddingStrategyConfiguration biddingStrategyConfiguration =
            new BiddingStrategyConfiguration();
       
        Money bidAmountMoney = new Money();
        bidAmountMoney.setMicroAmount(bidAmount);
        CpcBid cpcBid = new CpcBid();
        cpcBid.setBid(bidAmountMoney);
        biddingStrategyConfiguration.setBids(new Bids[] {cpcBid});
        BiddableAdGroupCriterion biddableCriterion = new BiddableAdGroupCriterion();
        biddableCriterion.setBiddingStrategyConfiguration(biddingStrategyConfiguration);
        criterion = biddableCriterion;
      } else {
        criterion = new NegativeAdGroupCriterion();
      }
     
      criterion.setAdGroupId(adGroupId);
      criterion.setCriterion(unit);
     
      operations.add(createAddOperation(criterion));

      return unit;
    }
View Full Code Here

      // 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

      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' "
                + "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

          user.getService(AdWordsService.V201309.ADGROUP_SERVICE);

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

      // Create ad group with DELETED status.
      AdGroup adGroup = new AdGroup();
      adGroup.setId(adGroupId);
      adGroup.setStatus(AdGroupStatus.DELETED);

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

          user.getService(AdWordsService.V201309.ADGROUP_SERVICE);

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

      // Create ad group with updated status.
      AdGroup adGroup = new AdGroup();
      adGroup.setId(adGroupId);
      adGroup.setStatus(AdGroupStatus.PAUSED);

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

      }

      Long experimentId = result.getValue()[0].getId();

      // Set ad group for the experiment.
      AdGroup adGroup = new AdGroup();
      adGroup.setId(adGroupId);

      // Create experiment bid multiplier rule that will modify ad group bid for
      // the experiment.
      ManualCPCAdGroupExperimentBidMultipliers adGroupExperimentBidMultipliers =
          new ManualCPCAdGroupExperimentBidMultipliers();
      adGroupExperimentBidMultipliers.setMaxCpcMultiplier(new BidMultiplier(1.5, null));

      // Set experiment data to the ad group.
      AdGroupExperimentData adGroupExperimentData = new AdGroupExperimentData();
      adGroupExperimentData.setExperimentId(experimentId);
      adGroupExperimentData.setExperimentDeltaStatus(ExperimentDeltaStatus.MODIFIED);
      adGroupExperimentData.setExperimentBidMultipliers(adGroupExperimentBidMultipliers);
      adGroup.setExperimentData(adGroupExperimentData);

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

      // Update ad group.
      adGroup = adGroupService.mutate(new AdGroupOperation[]{adGroupOperation}).getValue()[0];

      System.out.println("Ad group with name \"" + adGroup.getName() + "\" and id \""
          + adGroup.getId() + "\" was updated for the experiment.");

      // Set ad group criterion for the experiment.
      BiddableAdGroupCriterion adGroupCriterion = new BiddableAdGroupCriterion();
      adGroupCriterion.setCriterion(new Criterion(criterionId, null, null));
      adGroupCriterion.setAdGroupId(adGroupId);
View Full Code Here

      Predicate adGroupIdPredicate =
          new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
      selector.setPredicates(new Predicate[] {adGroupIdPredicate});

      // Get bid landscape for ad group criteria.
      AdGroupBidLandscapePage page = dataService.getAdGroupBidLandscape(selector);

      // Display bid landscapes.
      if (page.getEntries() != null) {
        for (AdGroupBidLandscape adGroupBidLandscape : page.getEntries()) {
          System.out.println("Ad group bid landscape with ad group id \""
              + adGroupBidLandscape.getAdGroupId() + "\", type \""
              + adGroupBidLandscape.getType() + "\", current \""
              + adGroupBidLandscape.getLandscapeCurrent() + "\", start date \""
              + adGroupBidLandscape.getStartDate() + "\", end date \""
View Full Code Here

TOP

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