Updating Keyword Max CPC

916 views
Skip to first unread message

Steve

unread,
Jun 22, 2012, 5:57:20 PM6/22/12
to adwor...@googlegroups.com
Hi,

Is it possible to update the maxCpc of an existing keyword through the API?

If it is, can someone provide an example in PHP? I tried the following and it did not work:

        $bids = new ManualCPCAdGroupCriterionBids();
        $bids->maxCpc = new Bid(new Money(1000000));
        $adGroupCriterion->bids = $bids; 

Thank you in advance for taking time to help me out.

Steve


Anash P. Oommen

unread,
Jun 26, 2012, 5:42:59 AM6/26/12
to adwor...@googlegroups.com
Hi Steve,

What errors are you seeing? From what I can tell, your code seems fine. See the code example from .NET client library for reference.  http://code.google.com/p/google-api-adwords-dotnet/source/browse/trunk/examples/adwords/csharp/v201109_1/BasicOperations/UpdateKeyword.cs 

Cheers,A
Anash P. Oommen,
AdWords API Advisor.

Steve

unread,
Jun 26, 2012, 12:43:23 PM6/26/12
to adwor...@googlegroups.com
Hi Anash!

Thanks for the response and the code example. It was useful.

Following up:

I'm not getting an error. The code is simply not updating the maxCPC of an existing keyword. I'm in the sand box, do you think that could cause the issue? Sandbox Behavior?

Here is a full view of the code I'm using. Perhaps, the order in which I'm executing the objects is causing the issue?

        $criterion = new Criterion();
        $criterion->id = $ary['criterionId'];

        // Create ad group criterion.
        $adGroupCriterion = new BiddableAdGroupCriterion();
        $adGroupCriterion->adGroupId = $this->adGroupId;
        $adGroupCriterion->criterion = new Criterion($ary['criterionId']);
        
        $bids = new ManualCPCAdGroupCriterionBids();
        $bids->maxCpc = new Bid(new Money(1000000));
        $adGroupCriterion->bids = $bids;      

        // Create operation.
        $operation = new AdGroupCriterionOperation();
        $operation->operand = $adGroupCriterion;
        $operation->operator = 'SET';

        $operations = array($operation);

Thanks again for your assistance. It's much appreciated.

Steve

Felipe Gómez Restrepo

unread,
Mar 27, 2018, 5:07:20 AM3/27/18
to AdWords API Forum
Use follow code:

$bid = new CpcBid();
$money = new Money();
$money->setMicroAmount(1095000000); //Change this to your micro value.
$bid->setBid($money);
$biddingStrategyConfiguration = new BiddingStrategyConfiguration();
$biddingStrategyConfiguration->setBids([$bid]);
$adGroupCriterion->setBiddingStrategyConfiguration($biddingStrategyConfiguration);
Reply all
Reply to author
Forward
0 new messages