首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法启用使用google adwords api设置每次点击的最大成本竞价限制和设置最大竞价

无法启用使用google adwords api设置每次点击的最大成本竞价限制和设置最大竞价
EN

Stack Overflow用户
提问于 2020-03-18 21:30:12
回答 1查看 50关注 0票数 0

我已经创建了谷歌adCampaigns,adGroups,关键字,广告,位置使用谷歌广告应用程序接口,但我不能设置“设置最大成本每次点击投标限制”使用API

我已经使用此代码进行了设置,但未进行设置

代码语言:javascript
复制
       $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);
EN

回答 1

Stack Overflow用户

发布于 2020-03-19 19:15:27

代码语言:javascript
复制
    $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);

在活动级别执行此操作以设置最大出价限制

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60740634

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档