Hi,
just a few comments on the migration to 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