Hi,
I need to update the bid of 500 Ads in AdGroups more than 10 000 times in a day. That's why I try to pack all operations in one to avoid the over query limit but I think I don't understand something.
I followed examples to have this code :
myfunction($user, $adGroupIds, $value)
{
$mutateJobService = $user->GetService('MutateJobService', "v201406");
$operations = array();
foreach ($adGroupIds as $adGroupId)
{
$adGroup = new AdGroup();
$adGroup->id = $adGroupId;
$bid = new CpcBid();
$bid->bid = new Money($value);
$biddingStrategyConfiguration = new BiddingStrategyConfiguration();
$biddingStrategyConfiguration->bids[] = $bid;
$adGroup->biddingStrategyConfiguration = $biddingStrategyConfiguration;
$operation = new AdGroupOperation();
$operation->operand = $adGroup;
$operation->operator = 'SET';
$operations[] = $operation;
}
$policy = new BulkMutateJobPolicy();
$policy->prerequisiteJobIds = array();
$job = $mutateJobService->mutate($operations, $policy);
$selector = new BulkMutateJobSelector();
$selector->jobIds[] = $job->id;
while ($job->status != "COMPLETED")
{
$jobs = $mutateJobService->get($selector);
$job = $jobs[0];
}
if ($job->status == "COMPLETED")
{
echo "job completed";
}
}
With this code, I still have "[RateExceededError <rateName=BillingPerDay, rateKey=level1_plan, rateScope=DEVELOPER, retryAfterSeconds=86400>]" after 10 000 updates.
Could someone explain me what I do wrong ?
Thanks,
Maxime