Package com.google.api.adwords.v201008.cm

Examples of com.google.api.adwords.v201008.cm.AdGroupAdServiceInterface.mutate()


    textAdGroupAdOperation.setOperand(textAdGroupAd);
    textAdGroupAdOperation.setOperator(Operator.ADD);
    AdGroupAdOperation[] operations = new AdGroupAdOperation[] {textAdGroupAdOperation};

    // Add new TextAd and return its ID.
    return adGroupAdService.mutate(operations).getValue()[0].getAd().getId();
  }

  /**
   * Creates a new keyword
   *
 
View Full Code Here


    AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] {
        keywordAdGroupCriterionOperation, placementAdGroupCriterionOperation};

    // Add ad group criteria and return Criterion ID.
    return adGroupCriterionService.mutate(operations).getValue()[0].getCriterion().getId();
  }

  /**
   * Creates negative campaign keyword criterion
   *
 
View Full Code Here

    operation.setOperator(Operator.ADD);

    AdGroupOperation[] operations = new AdGroupOperation[] {operation};

    // Add ad group and return AdGroup ID.
    return adGroupService.mutate(operations).getValue()[0].getId();
  }

  /**
   * Creates a new TextAd
   *
 
View Full Code Here

    adParamOperation2.setOperator(Operator.SET);

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

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

  /**
   * Creates a location extension.
   *
 
View Full Code Here

    operation.setOperator(Operator.ADD);

    CampaignAdExtensionOperation[] operations = new CampaignAdExtensionOperation[] {operation};

    // Add campaign ad extension and retrun AdExtension ID.
    return campaignAdExtensionService.mutate(operations).getValue()[0].getAdExtension().getId();
  }

  /**
   * Creates an ad extension override.
   *
 
View Full Code Here

    CampaignCriterionOperation operation = new CampaignCriterionOperation();
    operation.setOperand(negativeCampaignCriterion);
    operation.setOperator(Operator.ADD);

    // Add campaign criteria and return Criterion ID
    return campaignCriterionService.mutate(new CampaignCriterionOperation[] {operation})
      .getValue()[0].getCriterion().getId();
  }

  /**
   * Sets an ad parameter on a keyword criterion.
View Full Code Here

    operation.setOperator(Operator.ADD);

    CampaignOperation[] operations = new CampaignOperation[] {operation};

    // Add campaign and return campaign ID
    return campaignService.mutate(operations).getValue()[0].getId();
  }

  /**
   * Delete a campaign specified by campaign ID.
   *
 
View Full Code Here

    operation.setOperator(Operator.SET);

    CampaignOperation[] operations = new CampaignOperation[] {operation};

    // Delete campaign.
    CampaignReturnValue result = campaignService.mutate(operations);
  }

  /**
   * Creates a new adgroup under the campaign.
   *
 
View Full Code Here

      AdGroupAdOperation[] operations =
          new AdGroupAdOperation[] {exemptableOperation, nonExemptableOperation};

      try {
        // Validate the ads.
        AdGroupAdReturnValue result = adGroupAdValidationService.mutate(operations);
      } catch (ApiException e) {
        Set<Integer> indicesToRemove = new HashSet<Integer>();
        for (ApiError error : e.getErrors()) {
          if (error instanceof PolicyViolationError) {
            PolicyViolationError policyVioloationError = (PolicyViolationError) error;
View Full Code Here

    AdGroupAdOperation operation = new AdGroupAdOperation();
    operation.setOperator(Operator.ADD);
    operation.setOperand(clickToDownloadAppAdGroupAd);

    // Create the ads.
    AdGroupAdReturnValue result = adGroupAdService.mutate(new AdGroupAdOperation[] {operation});

    for (AdGroupAd adGroupAd : result.getValue()) {
      System.out.printf(
          "New click-to-download ad with id = \"%d\" and url = \"%s\" was created.",
          adGroupAd.getAd().getId(), adGroupAd.getAd().getUrl());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.