我已经有了要使用 google AdWords API 更新的广告系列预算。
BudgetServiceInterface budgetService =
adWordsServices.get(session, BudgetServiceInterface.class);
// Create a budget, which can be shared by multiple campaigns.
Budget sharedBudget = new Budget();
sharedBudget.setName("Interplanetary Cruise #" + System.currentTimeMillis());
Money budgetAmount = new Money();
budgetAmount.setMicroAmount(50_000_000L);
sharedBudget.setAmount(budgetAmount);
sharedBudget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
BudgetOperation budgetOperation = new BudgetOperation();
budgetOperation.setOperand(sharedBudget);
budgetOperation.setOperator(Operator.ADD);
// Add the budget
Long budgetId =
budgetService.mutate(new BudgetOperation[] {budgetOperation}).getValue(0).getBudgetId();
// Get the CampaignService.
CampaignServiceInterface campaignService =
adWordsServices.get(session, CampaignServiceInterface.class);
将budgetId 分配给广告系列
Budget budget = new Budget();
budget.setBudgetId(budgetId);
campaign.setBudget(budget);
这将取消分配现有的广告系列预算并将新的广告系列预算分配给广告系列(广告系列预算未删除,它仍然存在于谷歌广告中)但我想更新现有广告系列预算的预算名称和预算金额,而不是分配新的广告系列预算。