当我将平台出价标准设置为 0 时,它给了我一个错误:


// Mobile criterion ID.
$mobileCriterionId = 30001;
$platform = new Platform();
$platform->id = $mobileCriterionId;

$operations = array();
foreach ([$location, $language, $platform] as $criterion) {
  // create criteria
  $campaignCriterion = new CampaignCriterion();
  $campaignCriterion->campaignId = $campaign->id;
  $campaignCriterion->criterion = $criterion;

  if ($criterion == $platform)
    $campaignCriterion->bidModifier = 0;

  // create operations to perform
  $operation = new CampaignCriterionOperation();
  $operation->operand = $campaignCriterion;
  $operation->operator = 'ADD';
  $operations[] = $operation;
}

// carry out the operations
$result = $campaignCriterionService->mutate($operations);

平台:https://developers.google.com/adwords/api/docs/appendix/platforms

标准使用矩阵:https://developers.google.com/adwords/api/docs/guides/criteria-usage

示例(针对广告组):https://developers.google.com/adwords/api/docs/guides/adgroup-bid-modifiers#update

事件标准:https://developers.google.com/adwords/api/docs/reference/v201502/CampaignCriterionService.CampaignCriterion

版本:v201502,测试账号

最佳答案

我不得不使用“SET”而不是“ADD”操作,但仅适用于平台。很明显吧?

  if ($criterion == $platform)
    $operation->operator = 'SET'; # all platforms automatically added to new campaigns. cannot re-ad. must set.

关于php - 如何降低 Google AdWords API 广告系列的移动出价标准?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31665689/

10-11 17:36