The BiddableAdGroupCriterion has a data member 'bids' that holds a Bid
instance that holds a Money instance that specifies the actual cpc
value. For example, in Java one might do the following :

assuming the following args are passed in: long id, long adGroupId, long cpc

        Criterion keyword = new Criterion();
        keyword.setId( id );

        BiddableAdGroupCriterion biddableAdGroupCriterion = new
BiddableAdGroupCriterion();
        biddableAdGroupCriterion.setAdGroupId( adGroupId );
        biddableAdGroupCriterion.setCriterion( keyword );

        // create a bid, give it the new cpc
        ManualCPCAdGroupCriterionBids bids = new
ManualCPCAdGroupCriterionBids();
        bids.setMaxCpc(new Bid(new Money(null, cpc)));
        biddableAdGroupCriterion.setBids(bids);

        AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
        operation.setOperand( biddableAdGroupCriterion );
        operation.setOperator( Operator.SET );
        AdGroupCriterionOperation[] operations = new
AdGroupCriterionOperation[] {operation};

        AdGroupCriterionReturnValue result = agrCritService.mutate(operations);


On Thu, Jan 14, 2010 at 9:57 AM, Guillaume <voisineo...@gmail.com> wrote:
> Hi,
>
> i succeeded in creating keywords for a campain, but i don't understand
> where and how i can define the MaxCPC for each keyword i create with
> the code below :
>
>  // Create keyword.
>  $keyword = new Keyword();
>  $keyword->text = 'mars cruise';
>  $keyword->matchType = 'BROAD';
>
>  // Create biddable ad group criterion.
>  $keywordAdGroupCriterion = new BiddableAdGroupCriterion();
>  $keywordAdGroupCriterion->adGroupId = $adGroupId;
>  $keywordAdGroupCriterion->criterion = $keyword;
>
>  // Create operations.
>  $keywordAdGroupCriterionOperation = new AdGroupCriterionOperation();
>  $keywordAdGroupCriterionOperation->operand =
> $keywordAdGroupCriterion;
>  $keywordAdGroupCriterionOperation->operator = 'ADD';
>
>  $operations = array($keywordAdGroupCriterionOperation);
>
>  // Add ad group criteria.
>  $result = $adGroupCriteriaService->mutate($operations);
>
>
> Thanks for your help !
>
> Guillaume
>
> --
> 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-...@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.
>
>
>
>



-- 
rp johns
-- 
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-...@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.


Reply via email to