How to update keyword MaxCPC via api in php

31 views
Skip to first unread message

Thom Ho

unread,
Nov 16, 2020, 4:49:45 AM11/16/20
to AdWords API and Google Ads API Forum
Hi How can I update the keyword MaxCPC in php via google ads api?

I am using following code, but nothing was changed after trying.
        if (!is_null($cpcAmount)) {
            $bid = new \Google\AdsApi\AdWords\v201809\cm\CpcBid();
            $money = new \Google\AdsApi\AdWords\v201809\cm\Money();
            $money->setMicroAmount($cpcAmount * 1000000);
            $bid->setBid($money);
            $biddingStrategyConfiguration = new \Google\AdsApi\AdWords\v201809\cm\BiddingStrategyConfiguration();
            $biddingStrategyConfiguration->setBids([$bid]);
            $adGroup->setBiddingStrategyConfiguration($biddingStrategyConfiguration);
        }

// Create ad group operation and add it to the list.
        $operation = new AdGroupOperation();
        $operation->setOperand($adGroup);
        $operation->setOperator(Operator::SET);
        $operations[] = $operation;

// Update the ad group on the server.
        return $adGroupService->mutate($operations);

Could you please help why it is not updating the changed value?

Thanks

Google Ads API Forum Advisor Prod

unread,
Nov 16, 2020, 11:43:21 AM11/16/20
to cgthomd...@gmail.com, adwor...@googlegroups.com
Hello,

You can refer to this example which updates a keyword's bid in PHP.

Cheers,
Anthony
Google Ads API Team

Google Logo
Anthony
Google Ads API Team
 


ref:_00D1U1174p._5004Q27u6Mf:ref
Reply all
Reply to author
Forward
0 new messages