Thanks Josh,

The snippet worked.

On Wednesday, March 12, 2014 6:41:05 AM UTC-7, Josh Radcliff (AdWords API 
Team) wrote:
>
> Hi,
>
> It looks like you simply want to set a CPC bid on your ad group criteria. 
>  If that's the case, then I'd recommend taking a look at the latest 
> AddKeywords.php<https://github.com/googleads/googleads-php-lib/blob/master/examples/AdWords/v201402/BasicOperations/AddKeywords.php#L65>
>  example. 
>  The relevant snippet is below.
>
>         // Set bids (optional).
>     $bid = new CpcBid();
>     $bid->bid =  new Money(500000);
>     $biddingStrategyConfiguration = new BiddingStrategyConfiguration();
>     $biddingStrategyConfiguration->bids[] = $bid;
>     $adGroupCriterion->biddingStrategyConfiguration = 
> $biddingStrategyConfiguration;
>
> I think that covers your use case, but please post back if I'm mistaken.
>
> Cheers,
> Josh, AdWords API Team
>
> On Wednesday, March 12, 2014 2:33:44 AM UTC-4, jaison....@gmail.com wrote:
>>
>> Hi Josh,
>>
>> I'm using version v201309 of the Adwords API.
>>
>> Shown below is the code I'm using to add keywords with maxCPC.
>>
>> function addKeywordsToAdGroup(AdWordsUser $user, $adGroupId, $keywords){
>>     $user->SetClientCustomerId($_SESSION['adwordClientId']);
>>     $adGroupCriterionService = 
>> $user->GetService('AdGroupCriterionService', ADWORDS_VERSION);
>>     $operations                     = array();
>>
>>     foreach ($keywords as $adKeyword => $value) {
>>         // Create keyword criterion.
>>         $keyword                     = new Keyword();
>>         $adKeyword                 = str_replace(',', '', $adKeyword);
>>         $keyword->text             = $adKeyword;
>>         $keyword->matchType  = 'EXACT';
>>
>>         // Create biddable ad group criterion.
>>         $adGroupCriterion                   = new 
>> BiddableAdGroupCriterion();
>>         $adGroupCriterion->adGroupId = $adGroupId;
>>         $adGroupCriterion->criterion    = $keyword;
>>
>>         // Set bids for the keyword
>>         if(!empty($value)){
>>             $bids                             = new 
>> ManualCPCAdGroupCriterionBids();
>>             $bidValue                      = $value * 100000;
>>             $bids->maxCpc              = new Bid(new Money($bidValue));
>>             $adGroupCriterion->bids = $bids;
>>         }
>>
>>         $adGroupCriteria[]   = $adGroupCriterion;
>>
>>         // Create operation.
>>         $operation                   = new AdGroupCriterionOperation();
>>         $operation->operand    = $adGroupCriterion;
>>         $operation->operator    = 'ADD';
>>         $operations[]               = $operation;
>>     }
>>
>>     // Make the mutate request.
>>     return $result = $adGroupCriterionService->mutate($operations);
>> }
>>
>>
>>
>>
>> On Tuesday, March 11, 2014 3:05:07 PM UTC-7, Josh Radcliff (AdWords API 
>> Team) wrote:
>>>
>>> Hi,
>>>
>>> Could you specify which version of the API and library you are using, as 
>>> well as post your modified version of the AddKeywords example?
>>>
>>> Thanks,
>>> Josh, AdWords API Team
>>>
>>> On Tuesday, March 11, 2014 10:11:38 AM UTC-4, jaison....@gmail.comwrote:
>>>>
>>>> Hi,
>>>>
>>>> I'm using the PHP library of adwords API. Addition of keywords to 
>>>> AdGroup works properly. If I try to set the maxCPC of a keyword during the 
>>>> addition process I get an error stating that 
>>>> the ManualCPCAdGroupCriterionBids class could not be found.
>>>>
>>>> I have been referring to the AddKeywordsExample example provided in the 
>>>> library.
>>>>
>>>> Has anyone encountered this issue and how did you resolve it.
>>>>
>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to