google-ads-api - 无法启用设置最高每次点击费用出价限制并使用 google adwords api 设置最高出价
问题描述
我已经使用 Google Adwords API 创建了 google adCampaigns、adGroups、Keywords、Ads、Locations,但我无法使用 api 设置“设置每次点击费用的最高出价限制”
我已使用此代码进行设置,但未设置
$operations = [];
// Create ad group with the specified ID.
$groupId = $adGroup->getId();
$adGroupNew = new AdGroup();
$adGroupNew->setId($groupId);
$cpcBidMicroAmount = intval($_GET['cpc']) * 1000000;
// Update the CPC bid if specified.
if (!is_null($cpcBidMicroAmount)) {
$bid = new CpcBid();
$money = new Money();
$money->setMicroAmount($cpcBidMicroAmount);
$bid->setBid($money);
$biddingStrategyConfiguration = new BiddingStrategyConfiguration();
$biddingStrategyConfiguration->setBids([$bid]);
$adGroup->setBiddingStrategyConfiguration($biddingStrategyConfiguration);
}
// Create ad group operation and add it to the list.
$operation = new AdGroupOperation();
$operation->setOperand($adGroupNew);
$operation->setOperator(Operator::SET);
$operations[] = $operation;
// Update the ad group on the server.
$adGroupService->mutate($operations);
解决方案
$biddingScheme = new TargetSpendBiddingScheme();
$bidCeiling = new Money();
$bidCeiling->setMicroAmount($_GET['cpc'] * 1000000);
$biddingScheme->setBidCeiling($bidCeiling);
$spendTarget = new Money();
$spendTarget->setMicroAmount($_GET['cpc'] * 1000000);
$biddingScheme->setSpendTarget($spendTarget);
在广告系列级别执行此操作以设置竞价上限
推荐阅读
- kubernetes - 版本“extensions/v1beta1”中没有匹配类型“DaemonSet”
- java - 使用 GSON 解析 Java 中的 JSON 文件
- php - MySQL将表复制到具有相同凭据的不同数据库
- python - 如何在文件中查找重复句子的频率
- laravel - laravel 数据表在 addColumn 中搜索
- json - 发送 JSON 对象而不是 JSON 字符串
- node.js - 我的 node.js Web 应用程序无法识别我的 manifest.json
- fonts - Web 组件 - 字体和材质图标不起作用 (@font-face)
- salesforce-lightning - 接受按钮未显示在 Salesforce Lightning 的案例列表视图中
- c -
用于窗户