Does this code actually update the Keyword Max CPC and Status for a
keyword? Or does it create a new keyword that overwrites the old one,
and therefore losing all data associated with it?

Chris

On Feb 12, 2:40 pm, Joe_Rocket <[email protected]> wrote:
> OK, I got it.  Code is almost correct.  Just needed PAUSED and Not
> PAUSE
>
> On Feb 12, 10:51 am, Joe_Rocket <[email protected]> wrote:
>
>
>
> > I have anupdatefunction that updatesKeywordMax CPC and Status.
> > The Max CPC updates fine.  But theKeywordStatus does not change.
> > Can you see anything wrong with this code?  Thanks in advance.
>
> >         /**
> >          *
> >          * @param int $belongsToAdGroupId
> >          * @param int $kwid
> >          * @param int $maxCPC
> >          * @param bool $pause
> >          * @return array
> >          */
> >         public function updateKeyword($belongsToAdGroupId, $kwid, $maxCPC,
> > $pause){
>
> >                 $result = null;
> >                 $adGroupCriteriaService = $this->adWordsUser-
>
> > >GetAdGroupCriterionService('v200909');
>
> >                 // Create ad group criterion.
> >                 $adGroupCriterion = new BiddableAdGroupCriterion();
> >                 $adGroupCriterion->adGroupId = (float)$belongsToAdGroupId;
> >                 $adGroupCriterion->criterion = new Criterion($kwid);
> >                 $adGroupCriterion->userStatus = ($pause) ? 'PAUSE' : 
> > 'ACTIVE';
>
> >                 // Create bids.
> >                 $bids = new ManualCPCAdGroupCriterionBids();
> >                 $bids->maxCpc = new Bid(new Money($maxCPC));
> >                 $adGroupCriterion->bids = $bids;
>
> >                 // Create operations.
> >                 $operation = new AdGroupCriterionOperation();
> >                 $operation->operand = $adGroupCriterion;
> >                 $operation->operator = 'SET';
>
> >                 $operations = array($operation);
>
> >                 try{
> >                         $keywords = 
> > $adGroupCriteriaService->mutate($operations);
> >                         $result = $this->packageResultsAsArray($keywords);
> >                 }catch (SoapFault $fault) {
> >                         //Extract error and place on fault stack
> >                         $this->checkFault($fault);
> >                 }
>
> >                 return $result;
> >         }

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

To unsubscribe from this group, send email to 
adwords-api+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to