Hi, 
just a few comments on the migration to v201710.

I upgraded recently. I see there "AdServingOptimizationStatus" should cause 
a CANNOT_SET_AD_ROTATION_MODE error if you are still setting it on Campaign 
level based on the migration guide: 
https://developers.google.com/adwords/api/docs/guides/migration/v201710

However, if you create a campaign without setting the 
AdServingOptimizationStatus, the campaign object returned by Adwords API 
contains this AdServingOptimizationStatus parameter, and its value is "null
".

When I then tried to update this created campaign, the 
CANNOT_SET_AD_ROTATION_MODE error appears due to the campaign object now 
having an AdServingOptimizationStatus parameter. There is no way to remove 
this parameter from the object then, as adServingOptimizationStatus is a 
private variable in Google\AdsApi\AdWords\v201710\cm\Campaign. This 
inevitably causes an error, as Adwords API returned object contains a 
parameter that the documentation explicitly says causes an error.

For some reason I cannot understand, setting this parameter to null gets 
rid of this error by using the getAdServingOptimizationStatus() method. 
This is very strange that this would stop the error, as the 
adServingOptimizationStatus parameter is already null in the object.

I am using the code below suggested in the documentation ("$campaign" is a 
campaign object returned after creation through API.):

$campaign->setStatus(CampaignStatus::REMOVED);

$operation = new CampaignOperation();
$operation->setOperand($campaign);
$operation->setOperator(Operator::SET);
$operations[] = $operation;

$result = $campaignService->mutate($operations);

The only thing that fixes the error from the above code is adding this line 
at the top of the code:
$campaign->setAdServingOptimizationStatus(null);

I have tried this with multiple campaigns. It appears to be a bug.

On a related note, creating the campaign with the AdServingOptimizationStatus 
parameter does not seem to cause an error as the documentation suggests.

Can you confirm this is the case, or suggest what is incorrect with 
description above?

Regards, 
Declan

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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
--- 
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 [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/0e0122a4-36ac-46bf-88da-af561dd0685d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Issue with AdSer... Declan Keane
    • Re: Issue w... 'Vincent Racaza (AdWords API Team)' via AdWords API Forum

Reply via email to