* @param campaignId the id of the parent campaign
* @return the id of the created criterion
*/
public long createNegativeCampaignKeyword(long campaignId) throws Exception {
// Get the CampaignCriterionService.
CampaignCriterionServiceInterface campaignCriterionService =
user.getService(AdWordsService.V201008.CAMPAIGN_CRITERION_SERVICE);
// Create keyword.
Keyword keyword = new Keyword();
keyword.setText("jupiter cruise");
keyword.setMatchType(KeywordMatchType.BROAD);
// Create negative campaign criterion.
NegativeCampaignCriterion negativeCampaignCriterion = new NegativeCampaignCriterion();
negativeCampaignCriterion.setCampaignId(campaignId);
negativeCampaignCriterion.setCriterion(keyword);
// Create operations.
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();
}