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

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


  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId, Long keywordId)
      throws Exception {
    // Get the AdParamService.
    AdParamServiceInterface adParamService =
        adWordsServices.get(session, AdParamServiceInterface.class);

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

    AdParamOperation adParamOperation2 = new AdParamOperation();
    adParamOperation2.setOperand(adParam2);
    adParamOperation2.setOperator(Operator.SET);

    AdParamOperation[] operations = new AdParamOperation[] {adParamOperation1, adParamOperation2};

    // Set ad parameters.
    AdParam[] adParams = adParamService.mutate(operations);

    // Display ad parameters.
    for (AdParam adParam : adParams) {
      System.out.println("Ad parameter with ad group id \"" + adParam.getAdGroupId()
          + "\", criterion id \"" + adParam.getCriterionId() + "\", insertion text \""
View Full Code Here


  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId, Long keywordId)
      throws Exception {
    // Get the AdParamService.
    AdParamServiceInterface adParamService =
        adWordsServices.get(session, AdParamServiceInterface.class);

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

    AdParamOperation adParamOperation2 = new AdParamOperation();
    adParamOperation2.setOperand(adParam2);
    adParamOperation2.setOperator(Operator.SET);

    AdParamOperation[] operations = new AdParamOperation[] {adParamOperation1, adParamOperation2};

    // Set ad parameters.
    AdParam[] adParams = adParamService.mutate(operations);

    // Display ad parameters.
    for (AdParam adParam : adParams) {
      System.out.println("Ad parameter with ad group id \"" + adParam.getAdGroupId()
          + "\", criterion id \"" + adParam.getCriterionId() + "\", insertion text \""
View Full Code Here

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId, Long keywordId)
      throws Exception {
    // Get the AdParamService.
    AdParamServiceInterface adParamService =
        adWordsServices.get(session, AdParamServiceInterface.class);

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

    AdParamOperation adParamOperation2 = new AdParamOperation();
    adParamOperation2.setOperand(adParam2);
    adParamOperation2.setOperator(Operator.SET);

    AdParamOperation[] operations = new AdParamOperation[] {adParamOperation1, adParamOperation2};

    // Set ad parameters.
    AdParam[] adParams = adParamService.mutate(operations);

    // Display ad parameters.
    for (AdParam adParam : adParams) {
      System.out.println("Ad parameter with ad group id \"" + adParam.getAdGroupId()
          + "\", criterion id \"" + adParam.getCriterionId() + "\", insertion text \""
View Full Code Here

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId, Long keywordId)
      throws Exception {
    // Get the AdParamService.
    AdParamServiceInterface adParamService =
        adWordsServices.get(session, AdParamServiceInterface.class);

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

    AdParamOperation adParamOperation2 = new AdParamOperation();
    adParamOperation2.setOperand(adParam2);
    adParamOperation2.setOperator(Operator.SET);

    AdParamOperation[] operations = new AdParamOperation[] {adParamOperation1, adParamOperation2};

    // Set ad parameters.
    AdParam[] adParams = adParamService.mutate(operations);

    // Display ad parameters.
    for (AdParam adParam : adParams) {
      System.out.println("Ad parameter with ad group id \"" + adParam.getAdGroupId()
          + "\", criterion id \"" + adParam.getCriterionId() + "\", insertion text \""
View Full Code Here

   * @param adGroupId the id of the ad group
   * @param keywordId the id of the keyword criterion
   */
  public void setAdParam(long adGroupId, long keywordId) throws Exception {
    // Get the AdParamService.
    AdParamServiceInterface adParamService =
        user.getService(AdWordsService.V201008.AD_PARAM_SERVICE);

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

    AdParamOperation adParamOperation2 = new AdParamOperation();
    adParamOperation2.setOperand(adParam2);
    adParamOperation2.setOperator(Operator.SET);

    AdParamOperation[] operations = new AdParamOperation[] {adParamOperation1, adParamOperation2};

    // Set ad parameters.
    AdParam[] adParams = adParamService.mutate(operations);
  }
View Full Code Here

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

      // Get the AdParamService.
      AdParamServiceInterface adParamService =
          user.getService(AdWordsService.V201306.AD_PARAM_SERVICE);

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

      AdParamOperation adParamOperation2 = new AdParamOperation();
      adParamOperation2.setOperand(adParam2);
      adParamOperation2.setOperator(Operator.SET);

      AdParamOperation[] operations = new AdParamOperation[] {adParamOperation1, adParamOperation2};

      // Set ad parameters.
      AdParam[] adParams = adParamService.mutate(operations);

      // Display ad parameters.
      if (adParams != null) {
        for (AdParam adParam : adParams) {
          System.out.println("Ad parameter with ad group id \"" + adParam.getAdGroupId()
View Full Code Here

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

      // Get the AdParamService.
      AdParamServiceInterface adParamService =
          user.getService(AdWordsService.V201306.AD_PARAM_SERVICE);

      String adGroupId = "INSERT_AD_GROUP_ID_HERE";

      // Create selector.
      Selector selector = new Selector();
      Predicate predicate = new Predicate();
      predicate.setField("AdGroupId");
      predicate.setOperator(PredicateOperator.EQUALS);
      predicate.setValues(new String[] {adGroupId});
      selector.setPredicates(new Predicate[] {predicate});
      selector.setFields(new String[]{"AdGroupId", "CriterionId", "InsertionText", "ParamIndex"});

      // Get all ad parameters.
      AdParamPage page = adParamService.get(selector);

      // Display ad parameters.
      if (page.getEntries() != null && page.getEntries().length > 0) {
        for (AdParam adParam : page.getEntries()) {
          System.out.println("Ad parameter with ad group id \"" + adParam.getAdGroupId()
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

TOP

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

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.