GoogleAPI Adwords Budget
来源:互联网 发布:xp网络共享一键设置 编辑:程序博客网 时间:2024/06/13 23:37
预算
预算状态:
isExplicitlyShared = true, 预算共享
isExplicitlyShared = false, 只能由一个广告系列使用
给广告系列分配预算
新的广告系列:
// Get the BudgetService.
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(50000000L);
sharedBudget.setAmount(budgetAmount);
sharedBudget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
sharedBudget.setPeriod(BudgetBudgetPeriod.DAILY);
BudgetOperation budgetOperation = new BudgetOperation();
budgetOperation.setOperand(sharedBudget);
budgetOperation.setOperator(Operator.ADD);
// Execute the new budget operation and save the assigned budget ID.
Long budgetId =
budgetService.mutate(new BudgetOperation[] {budgetOperation}).getValue(0).getBudgetId();
Campaign campaign = new Campaign();
campaign.setName("Interplanetary Cruise #" + System.currentTimeMillis());
campaign.setStatus(CampaignStatus.PAUSED);
campaign.setAdvertisingChannelType(AdvertisingChannelType.SEARCH);
// Set the bidding strategy configuration.
BiddingStrategyConfiguration biddingStrategyConfiguration =
new BiddingStrategyConfiguration();
biddingStrategyConfiguration.setBiddingStrategyType(BiddingStrategyType.MANUAL_CPC);
campaign.setBiddingStrategyConfiguration(biddingStrategyConfiguration);
// Only the budgetId should be set.
Budget budget = new Budget();
budget.setBudgetId(budgetId);
campaign.setBudget(budget);
CampaignServiceInterface campaignService =
adWordsServices.get(session, CampaignServiceInterface.class);
CampaignOperation operation = new CampaignOperation();
operation.setOperand(campaign);
operation.setOperator(Operator.ADD);
CampaignOperation[] operations = new CampaignOperation[] {operation};
CampaignReturnValue result = campaignService.mutate(operations);
改变广告系列的预算CampaignService.mutate
SET operation, and set the budget attribute of the campaign to a Budget object with its budgetId
set to the ID of the existing budget (along with any other campaign fields that you might want to set).
去掉预算
1.确保没有ENABLED or PAUSED广告在使用它
// Retrieve a budget with budget ID of interest
Long budgetId = Long.parseLong("INSERT_BUDGET_ID_HERE");
Selector selector = new SelectorBuilder()
.fields(BudgetField.BudgetId, BudgetField.BudgetReferenceCount)
.orderAscBy(BudgetField.BudgetId)
.equals(BudgetField.BudgetId, budgetId.toString())
.build();
// (Code Excluded) Get a Budget object from the result of BudgetService.get
// Remove the budget only if its referenceCount == 0 (no campaigns are using it)
if (budget.getReferenceCount() == 0) {
BudgetServiceInterface budgetService =
adWordsServices.get(session, BudgetServiceInterface.class);
BudgetOperation operation = new BudgetOperation();
operation.setOperand(budget);
operation.setOperator(Operator.REMOVE);
BudgetOperation[] operations = new BudgetOperation[] {operation};
BudgetReturnValue result = budgetService.mutate(operations);
}
获取正在使用此预算的广告系列Long budgetId = Long.parseLong("INSERT_BUDGET_ID_HERE");
Selector selector = new SelectorBuilder()
.fields(CampaignField.Id, CampaignField.BudgetId)
.orderAscBy(CampaignField.Id)
.equals(CampaignField.BudgetId, budgetId.toString())
.build();
AWQL:SELECT BudgetId, BudgetName, Amount, IsBudgetExplicitlyShared,
AssociatedCampaignId, Impressions
FROM BUDGET_PERFORMANCE_REPORT
WHERE BudgetId = <YOUR_BUDGET_ID>
跟踪表现
Budget Performance Report 0 0
- GoogleAPI Adwords Budget
- GoogleAPI-Adwords-Bid Landscapes
- GoogleAPI-Adwords Labels
- GoogleAPI Adwords Ad Scheduling
- GoogleAPI-Adwords-Dynamic Search Ads
- Google AdWords
- Google AdWords
- c#访问googleAPI
- 二维码生成(GoogleAPI)
- poj Budget
- POJ2396 Budget
- Budget POJ
- poj2396 Budget
- POJ2396 Budget
- poj2396 Budget
- Google adwords的优化
- AdWords vs. AdSense
- 谷歌AdWords关键字软件
- ASP.NET应用程序与页面生命周期
- 关于Linux连接Oracle数据库报错Caused by: java.sql.SQLRecoverableException: IO Error: Connection timed out的解决方案
- 反转输出字符串
- laravel之Qiniu
- iOS推送
- GoogleAPI Adwords Budget
- UISwitch
- UILabel 调整行间距
- 字符串大小写转换(三种方法)
- java.lang.OutOfMemoryError: Java heap space
- linux非阻塞的socket EAGAIN的错误处理
- CodeForces 615A Bulbs
- Android 第四天(晚上)
- 通过Excel批量生成对应的SQL语句