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

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


    Predicate approvalStatusPredicate = new Predicate(
        "AdGroupCreativeApprovalStatus", PredicateOperator.IN, new String[] {"DISAPPROVED"});
    selector.setPredicates(new Predicate[] {adGroupIdPredicate, approvalStatusPredicate});

    // Get all disapproved ads.
    AdGroupAdPage page = adGroupAdService.get(selector);

    // Display ads.
    if (page.getEntries() != null && page.getEntries().length > 0) {
      for (AdGroupAd adGroupAd : page.getEntries()) {
        System.out.println("Ad with id \"" + adGroupAd.getAd().getId() + "\"" + " and type \""
            + adGroupAd.getAd().getAdType() + "\" was disapproved for the following reasons:");
        for (String reason : adGroupAd.getAd().getDisapprovalReasons()) {
          System.out.println("  \"" + reason + "\"");
        }
View Full Code Here


  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId) throws Exception {
    // Get the AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create selector.
    Selector selector = new Selector();
    selector.setFields(new String[] {"Id", "DisapprovalReasons"});
    selector.setOrdering(new OrderBy[] {new OrderBy("Id", SortOrder.ASCENDING)});

    // Create predicates.
    Predicate adGroupIdPredicate =
        new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
    Predicate approvalStatusPredicate = new Predicate(
        "AdGroupCreativeApprovalStatus", PredicateOperator.IN, new String[] {"DISAPPROVED"});
    selector.setPredicates(new Predicate[] {adGroupIdPredicate, approvalStatusPredicate});

    // Get all disapproved ads.
    AdGroupAdPage page = adGroupAdService.get(selector);

    // Display ads.
    if (page.getEntries() != null && page.getEntries().length > 0) {
      for (AdGroupAd adGroupAd : page.getEntries()) {
        System.out.println("Ad with id \"" + adGroupAd.getAd().getId() + "\"" + " and type \""
View Full Code Here

   * @throws Exception if an error occurs when mapping the feed for sitelinks.
   */
  private static void createSiteLinksFeedMapping(FeedMappingServiceInterface feedMappingService,
      SiteLinksFeed siteLinksFeed) throws Exception {
    // Map the FeedAttributeIds to the fieldId constants.
    AttributeFieldMapping linkTextFieldMapping = new AttributeFieldMapping();
    linkTextFieldMapping.setFeedAttributeId(siteLinksFeed.linkTextFeedAttributeId);
    linkTextFieldMapping.setFieldId(PLACEHOLDER_FIELD_SITELINK_LINK_TEXT);
    AttributeFieldMapping linkUrlFieldMapping = new AttributeFieldMapping();
    linkUrlFieldMapping.setFeedAttributeId(siteLinksFeed.linkUrlFeedAttributeId);
    linkUrlFieldMapping.setFieldId(PLACEHOLDER_FIELD_SITELINK_URL);

    // Create the FieldMapping and operation.
    FeedMapping feedMapping = new FeedMapping();
    feedMapping.setPlaceholderType(PLACEHOLDER_SITELINKS);
    feedMapping.setFeedId(siteLinksFeed.siteLinksFeedId);
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

    // Create ad group criterion with updated bid.
    Criterion criterion = new Placement();
    criterion.setId(placementId);

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

    // Create bids.
    BiddingStrategyConfiguration biddingStrategyConfiguration = new BiddingStrategyConfiguration();
    CpmBid bid = new CpmBid();
    bid.setBid(new Money(null, 10000000L));
    biddingStrategyConfiguration.setBids(new Bids[] {bid});
    biddableAdGroupCriterion.setBiddingStrategyConfiguration(biddingStrategyConfiguration);

    // Create operations.
    AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
    operation.setOperand(biddableAdGroupCriterion);
    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 \""
            + biddableAdGroupCriterion.getCriterion().getId()
            + "\", type \""
            + biddableAdGroupCriterion.getCriterion().getCriterionType()
            + "\", and bid \""
            + ((CpmBid) biddableAdGroupCriterion.getBiddingStrategyConfiguration().getBids()[0])
                .getBid().getMicroAmount() + "\" was updated.");
      }
    }
  }
View Full Code Here

    placement1.setUrl("http://mars.google.com");
    Placement placement2 = new Placement();
    placement2.setUrl("http://example.com/pluto");

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

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

    NegativeAdGroupCriterion placementNegativeAdGroupCriterion2 = new NegativeAdGroupCriterion();
    placementNegativeAdGroupCriterion2.setAdGroupId(adGroupId);
    placementNegativeAdGroupCriterion2.setCriterion(placement2);
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

      }
      Placement placement = new Placement();
      placement.setUrl(url);

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

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

      // Create placement
      Placement placement = new Placement();
      placement.setUrl(url);

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

      // Create operation.
      AdGroupCriterionOperation placementAdGroupCriterionOperation =
          new AdGroupCriterionOperation();
      placementAdGroupCriterionOperation.setOperand(placementBiddableAdGroupCriterion);
View Full Code Here

TOP

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