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