Problem with bulk operations

45 views
Skip to first unread message

Maxime Menigoz

unread,
Oct 14, 2014, 12:28:28 PM10/14/14
to adwor...@googlegroups.com
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

Michael Cloonan (AdWords API Team)

unread,
Oct 16, 2014, 2:05:16 PM10/16/14
to adwor...@googlegroups.com
Hello Maxime,

It appears that you have basic access. Please read our rate sheet guide carefully. Performing "get" operations in bulk will only use up 1 operation, but performing "mutate" operations in bulk still counts as 1 operation per item that you are mutating. This means that only the first 10,000 mutate operations on a given day will succeed.

Regards,
Mike, AdWords API Team
Reply all
Reply to author
Forward
0 new messages