Hi P.W.,

The order of the parameters to the constructor for the different
operations (CampaignOperation, AdGroupOperation, AdGroupAdOperation)
are not consistent.  This is because these classes are automatically
generated from the WSDL files and the order cannot be manipulated for
consistency.  As an alternative, create the object with an empty
constructor and set the fields manually in an order of your choosing:

  $operation = new AdGroupAdOperation();
  $operation->operand = $adText;
  $operation->operator = 'ADD';

Best,
- Eric

On Nov 26, 10:37 am, phpoo <[email protected]> wrote:
> Ok, I do not understand I was using the example of folder "/examples/
> v200909/AddAllCampaigns.php" not found in the documentation something
> told me to ADD AdGroups was another order of operation, and now to ADD
> TextAd is not so "new AdGroupAdOperation ($adText, NULL, 'ADD')"?
>
> thanks
> P.W
>
> On Nov 25, 8:01 pm, AdWords API Advisor <[email protected]>
> wrote:
>
>
>
> > Hi,
>
> > I believe the order of the objects in your constructor is wrong.  It
> > should be:
>
> >   $operations = array(new AdGroupOperation($adgroup1, 'ADD', NULL));
>
> > Best,
> > - Eric Koleda, AdWords API Team
>
> > On Nov 25, 3:11 pm, phpoo <[email protected]> wrote:
>
> > > Hi
> > > eu tenho um erro no meu script mas não entendo
> > > I'm trying to add a AdGroup and returns me an error.The section of
> > > code that the error is this
>
> > >  $operations = array(new AdGroupOperation(NULL, $adgroup1, 'ADD'));
> > >  $adgroupReturnValue = $AdGroupService->mutate($operations); #Add
> > > campaigns.
>
> > > When the print  $operations command returns that
> > > Array ( [0] => AdGroupOperation Object ( [operand] => [operator] =>
> > > AdGroup Object (
>
> > > And the error that returns is this
> > > SoapFault Object ( [message:protected] => [RequiredError.REQUIRED @
> > > operations[0].operator, OperatorError.OPERATOR_NOT_SUPPORTED @
> > > operations[0]]
>
> > > Can anyone help me?

--

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.


Reply via email to