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

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


    Keyword keyword2 = new Keyword();
    keyword2.setText("pluto");
    keyword2.setMatchType(KeywordMatchType.EXACT);

    // Create biddable ad group criterion.
    BiddableAdGroupCriterion keywordBiddableAdGroupCriterion1 = new BiddableAdGroupCriterion();
    keywordBiddableAdGroupCriterion1.setAdGroupId(adGroupId);
    keywordBiddableAdGroupCriterion1.setCriterion(keyword1);

    // You can optionally provide these field(s).
    keywordBiddableAdGroupCriterion1.setUserStatus(UserStatus.PAUSED);
    keywordBiddableAdGroupCriterion1.setDestinationUrl("http://example.com/mars");
    BiddingStrategyConfiguration biddingStrategyConfiguration = new BiddingStrategyConfiguration();
    CpcBid bid = new CpcBid();
    bid.setBid(new Money(null, 10000000L));
    biddingStrategyConfiguration.setBids(new Bids[] {bid});
    keywordBiddableAdGroupCriterion1.setBiddingStrategyConfiguration(biddingStrategyConfiguration);

    NegativeAdGroupCriterion keywordNegativeAdGroupCriterion2 = new NegativeAdGroupCriterion();
    keywordNegativeAdGroupCriterion2.setAdGroupId(adGroupId);
    keywordNegativeAdGroupCriterion2.setCriterion(keyword2);
View Full Code Here


      Keyword keyword = new Keyword();
      keyword.setText(keywordText);
      keyword.setMatchType(KeywordMatchType.BROAD);

      // Create biddable ad group criterion.
      BiddableAdGroupCriterion keywordBiddableAdGroupCriterion = new BiddableAdGroupCriterion();
      keywordBiddableAdGroupCriterion.setAdGroupId(adGroupId);
      keywordBiddableAdGroupCriterion.setCriterion(keyword);

      // Create operation.
      AdGroupCriterionOperation keywordAdGroupCriterionOperation =
          new AdGroupCriterionOperation();
      keywordAdGroupCriterionOperation.setOperand(keywordBiddableAdGroupCriterion);
View Full Code Here

      Keyword keyword = new Keyword();
      keyword.setText(text);
      keyword.setMatchType(KeywordMatchType.BROAD);

      // Create BiddableAdGroupCriterion.
      BiddableAdGroupCriterion bagc = new BiddableAdGroupCriterion();
      bagc.setAdGroupId(adGroupId);
      bagc.setCriterion(keyword);

      // Create AdGroupCriterionOperation.
      AdGroupCriterionOperation agco = new AdGroupCriterionOperation();
      agco.setOperand(bagc);
      agco.setOperator(Operator.ADD);
View Full Code Here

        adWordsServices.get(session, AdGroupCriterionServiceInterface.class);

    // https://developers.google.com/adwords/api/docs/appendix/genders
    Gender male = new Gender();
    male.setId(10L);
    BiddableAdGroupCriterion genderBiddableAdGroupCriterion = new BiddableAdGroupCriterion();
    genderBiddableAdGroupCriterion.setAdGroupId(adGroupId);
    genderBiddableAdGroupCriterion.setCriterion(male);

    // https://developers.google.com/adwords/api/docs/appendix/ages
    AgeRange undetermined = new AgeRange();
    undetermined.setId(503999L);
    NegativeAdGroupCriterion ageRangeNegativeAdGroupCriterion = new NegativeAdGroupCriterion();
View Full Code Here

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

      BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion();
      criterion.setAdGroupId(adGroupId);
      criterion.setCriterion(division);

      operations.add(createAddOperation(criterion));

      return division;
    }
View Full Code Here

        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();
      }
     
View Full Code Here

        for (int k = 0; k < numKeywords; k++) {
          Keyword keyword = new Keyword();
          keyword.setText("test" + generator.nextInt(5000));
          keyword.setMatchType(KeywordMatchType.PHRASE);

          BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion();
          criterion.setAdGroupId(adGroup.getId());
          criterion.setCriterion(keyword);

          criteriaOps.add(new AdGroupCriterionOperation(Operator.ADD, "ADD", criterion, null));
        }

        adGrouCriterionService.mutate(criteriaOps.toArray(new AdGroupCriterionOperation[] {}));
View Full Code Here

    Keyword keyword = new Keyword();
    keyword.setText("mars cruise");
    keyword.setMatchType(KeywordMatchType.BROAD);

    // Create biddable ad group criterion.
    BiddableAdGroupCriterion keywordBiddableAdGroupCriterion = new BiddableAdGroupCriterion();
    keywordBiddableAdGroupCriterion.setAdGroupId(adGroupId);
    keywordBiddableAdGroupCriterion.setCriterion(keyword);

    // Create placement.
    Placement placement = new Placement();
    placement.setUrl("http://mars.google.com");

    // Create biddable ad group criterion for placement.
    BiddableAdGroupCriterion placementBiddableAdGroupCriterion = new BiddableAdGroupCriterion();
    placementBiddableAdGroupCriterion.setAdGroupId(adGroupId);
    placementBiddableAdGroupCriterion.setCriterion(placement);

    // Create operations.
    AdGroupCriterionOperation keywordAdGroupCriterionOperation = new AdGroupCriterionOperation();
    keywordAdGroupCriterionOperation.setOperand(keywordBiddableAdGroupCriterion);
    keywordAdGroupCriterionOperation.setOperator(Operator.ADD);
View Full Code Here

    Keyword keyword = new Keyword();
    keyword.setText("mars cruise");
    keyword.setMatchType(KeywordMatchType.BROAD);

    // Create biddable ad group criterion.
    BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion();
    criterion.setAdGroupId(adGroupId);
    criterion.setCriterion(keyword);
    criterion.setUserStatus(UserStatus.PAUSED);
    criterion.setDestinationUrl("http://www.example.com");

    // Create bids.
    ManualCPCAdGroupCriterionBids bids = new ManualCPCAdGroupCriterionBids();
    bids.setMaxCpc(new Bid(new Money(null, 10000L)));
    criterion.setBids(bids);

    // Create operations.
    AdGroupCriterionOperation keywordAdGroupCriterionOperation = new AdGroupCriterionOperation();
    keywordAdGroupCriterionOperation.setOperand(criterion);
    keywordAdGroupCriterionOperation.setOperator(Operator.ADD);

    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());
    criterion.setApprovalStatus(testCriterion.getApprovalStatus());
    criterion.setAdGroupCriterionType(testCriterion.getAdGroupCriterionType());
    criterion.getBids().setAdGroupCriterionBidsType(
        testCriterion.getBids().getAdGroupCriterionBidsType());
    ((ManualCPCAdGroupCriterionBids) criterion.getBids())
        .getMaxCpc()
        .getAmount()
        .setComparableValueType(
            (((ManualCPCAdGroupCriterionBids) testCriterion.getBids()).getMaxCpc().getAmount()
                .getComparableValueType()));
    ((ManualCPCAdGroupCriterionBids) criterion.getBids())
        .setBidSource((((ManualCPCAdGroupCriterionBids) testCriterion.getBids()).getBidSource()));
    ((ManualCPCAdGroupCriterionBids) criterion.getBids())
        .setMaxCpc(((ManualCPCAdGroupCriterionBids) testCriterion.getBids()).getMaxCpc());
    ((ManualCPCAdGroupCriterionBids) criterion.getBids())
        .setEnhancedCpcEnabled(((ManualCPCAdGroupCriterionBids) testCriterion.getBids())
            .getEnhancedCpcEnabled());
    criterion.setFirstPageCpc(testCriterion.getFirstPageCpc());
    criterion.setQualityInfo(testCriterion.getQualityInfo());
    criterion.setStats(testCriterion.getStats());

    TestUtils.assertDeepReflectionEquals(criterion, testCriterion);
  }
View Full Code Here

  /**
   * Test updating an ad group criterion.
   */
  public void testUpdate() throws Exception {
    // Create criterion with criterionId
    BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion();
    criterion.setAdGroupId(adGroupId);
    criterion.setCriterion(new Criterion(criterionId, null));
    criterion.setUserStatus(UserStatus.PAUSED);

    // Create operations.
    AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
    operation.setOperand(criterion);
    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

TOP

Related Classes of com.google.api.adwords.v201306.cm.BiddableAdGroupCriterion

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.