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

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


          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

          user.getService(AdWordsService.V201309.ADGROUP_SERVICE);

      long campaignId = Long.parseLong("INSERT_CAMPAIGN_ID_HERE");

      // Create ad group.
      AdGroup adGroup = new AdGroup();
      adGroup.setName("Earth to Mars Cruises #" + System.currentTimeMillis());
      adGroup.setStatus(AdGroupStatus.ENABLED);
      adGroup.setCampaignId(campaignId);

      // Optional settings.
      // Targeting restriction settings - these settings only affect serving
      // for the Display Network.
      TargetingSetting targeting = new TargetingSetting();
      TargetingSettingDetail placements = new TargetingSettingDetail();
      placements.setCriterionTypeGroup(CriterionTypeGroup.PLACEMENT);
      placements.setTargetAll(Boolean.TRUE);
      TargetingSettingDetail verticals = new TargetingSettingDetail();
      verticals.setCriterionTypeGroup(CriterionTypeGroup.VERTICAL);
      verticals.setTargetAll(Boolean.FALSE);
      targeting.setDetails(new TargetingSettingDetail[] {placements, verticals});
      adGroup.setSettings(new Setting[] {targeting});

      // Created the bids.
      BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration();
      CpcBid cpcBid = new CpcBid();
      cpcBid.setBid(new Money(null, 1000000L));
      biddingConfig.setBids(new Bids[] {cpcBid});
      adGroup.setBiddingStrategyConfiguration(biddingConfig);
     
      // Create operations.
      AdGroupOperation operation = new AdGroupOperation();
      operation.setOperand(adGroup);
      operation.setOperator(Operator.ADD);
View Full Code Here

          user.getService(AdWordsService.V201309.ADGROUP_SERVICE);

      long campaignId = Long.parseLong("INSERT_CAMPAIGN_ID_HERE");

      // Create ad group.
      AdGroup adGroup = new AdGroup();
      adGroup.setName("Earth to Mars Cruises #" + System.currentTimeMillis());
      adGroup.setStatus(AdGroupStatus.ENABLED);
      adGroup.setCampaignId(campaignId);

      // Optional settings.
      // Targeting restriction settings - these settings only affect serving
      // for the Display Network.
      TargetingSetting targeting = new TargetingSetting();
      TargetingSettingDetail placements = new TargetingSettingDetail();
      placements.setCriterionTypeGroup(CriterionTypeGroup.PLACEMENT);
      placements.setTargetAll(Boolean.TRUE);
      TargetingSettingDetail verticals = new TargetingSettingDetail();
      verticals.setCriterionTypeGroup(CriterionTypeGroup.VERTICAL);
      verticals.setTargetAll(Boolean.FALSE);
      targeting.setDetails(new TargetingSettingDetail[] {placements, verticals});
      adGroup.setSettings(new Setting[] {targeting});

      BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration();
      CpmBid cpmBid = new CpmBid();
      cpmBid.setBid(new Money(null, 1000000L));
      biddingConfig.setBids(new Bids[] {cpmBid});
      adGroup.setBiddingStrategyConfiguration(biddingConfig);

      // Create operations.
      AdGroupOperation operation = new AdGroupOperation();
      operation.setOperand(adGroup);
      operation.setOperator(Operator.ADD);
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

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

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

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

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

      // 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");

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

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

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

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

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

      // Create ad params.
      AdParam adParam1 = new AdParam();
      adParam1.setAdGroupId(adGroupId);
      adParam1.setCriterionId(keywordId);
      adParam1.setInsertionText("100");
      adParam1.setParamIndex(1);

      AdParam adParam2 = new AdParam();
      adParam2.setAdGroupId(adGroupId);
      adParam2.setCriterionId(keywordId);
      adParam2.setInsertionText("$40");
      adParam2.setParamIndex(2);

      // Create operations.
      AdParamOperation adParamOperation1 = new AdParamOperation();
      adParamOperation1.setOperand(adParam1);
      adParamOperation1.setOperator(Operator.SET);
View Full Code Here

TOP

Related Classes of com.google.api.adwords.v201309.cm.AdGroup

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.