Hi,
Am getting below error

Array ( [status] => error [message] => Campaign Ad Rotation has not updated 
[data] => Array ( [errorResponse] => 
[CampaignError.CANNOT_SET_AD_ROTATION_MODE @ 
operations[0].operand.adServingOptimizationStatus] [errorMsg] => 
CANNOT_SET_AD_ROTATION_MODE ) ) 

My code is
       $session = self::setSession();
        $adWordsServices = new AdWordsServices();
        $campaignService = $adWordsServices->get($session, 
CampaignService::class);
        $campaignId = intval($campaignId);
        $operations = [];
        // Create a campaign with PAUSED status.
        $campaign = new Campaign();
        $campaign->setId($campaignId);
        $campaign->setAdServingOptimizationStatus('ROTATE_INDEFINITELY');

        // Create a campaign operation and add it to the list.
        $operation = new CampaignOperation();
        $operation->setOperand($campaign);
        $operation->setOperator(Operator::SET);
        $operations[] = $operation;


        // Update the campaign on the server.
        $result = $campaignService->mutate($operations);

Kindly clarify me


On Wednesday, August 5, 2020 at 8:51:11 PM UTC+5:30, adsapiforumadvisor 
wrote:
>
> Hello,
>
> You can find this setting as the AdServingOptimizationStatus 
> <https://developers.google.com/adwords/api/docs/reference/v201809/CampaignService.Campaign#adservingoptimizationstatus>
>  
> in the Campaign object.
>
> Cheers,
> Anthony
> Google Ads API Team
>
> ref:_00D1U1174p._5004Q23Higy:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/08e9f00f-2678-4150-be0a-a7a9d84b833eo%40googlegroups.com.

Reply via email to