如何为人口统计标准设置出价系数,例如性别或年龄范围

时间:2018-03-09 04:30:32

标签: php api google-adwords

如何为性别或年龄范围等人口统计标准设置出价系数?

我已经设置了google adwords示例代码中的一些基本操作: https://developers.google.com/adwords/api/docs/samples/php/basic-operations

我还设法通过平台设备提高出价并降低出价。但我一直在寻找年龄和性别,我还没有找到它。有人可以举例说明如何为性别或年龄范围的人口统计标准设置出价系数。谢谢!

添加,更新和移除出价调整

public static function runExample(AdWordsServices $adWordsServices,
    AdWordsSession $session, $adGroupId, $bidModifier) {
  $adGroupBidModifierService =
      $adWordsServices->get($session, AdGroupBidModifierService::class);

  $operations = [];

  // Mobile criterion ID.
  $criterionId = 30001;
  // Prepare to add an ad group level override.
  $adGroupBidModifier = new AdGroupBidModifier();
  $adGroupBidModifier->setAdGroupId($adGroupId);
  $adGroupBidModifier->setCriterion(new Platform());
  $adGroupBidModifier->getCriterion()->setId($criterionId);
  $adGroupBidModifier->setBidModifier($bidModifier);

  $operation = new AdGroupBidModifierOperation();

  // Create an ad group bid modifier operation and add it to the list.
  $operation->setOperator(Operator::ADD);
  $operation->setOperand($adGroupBidModifier);
  $operations[] = $operation;

  // Create the ad group bid modifier on the server and print out some
  // information for each created ad group criterion.
  $result = $adGroupBidModifierService->mutate($operations);
  foreach ($result->getValue() as $adGroupBidModifier) {
    printf(
        "Ad group ID %d, criterion ID %d was updated with "
            . "ad group level modifier: %s\n",
        $adGroupBidModifier->getAdGroupId(),
        $adGroupBidModifier->getCriterion()->getId(),
        $adGroupBidModifier->getBidModifier()
    );
  }
}

现在可以在https://developers.google.com/adwords/api/docs/guides/bidding

中找到此代码

这个例子的确随着平台的增加而减少。

1 个答案:

答案 0 :(得分:0)

有一个Google adwords开发者会回答您问题的论坛。我在该论坛上做过一些研究,看起来已经得到了回答。

与答案相同的问题:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!searchin/adwords-api/bid $ $ 20on $ 20demographic 20criteria |排序:日期/ AdWords的-API / bq3ZjG8xbfI / l35zWdbiAwAJ

快速浏览:

    $adGroupCriterionService = $adWordsServices->get($session, AdGroupCriterionService::class);
    $operations = [];

    $genderTarget = new Gender();
    $genderTarget->setId(10);
    $genderBiddableAdGroupCriterion = new BiddableAdGroupCriterion();
    $genderBiddableAdGroupCriterion->setAdGroupId($adGroupId);
    $genderBiddableAdGroupCriterion->setCriterion($genderTarget);
    $genderBiddableAdGroupCriterion->setBidModifier(1.1);

    $genderBiddableAdGroupCriterionOperation = new AdGroupCriterionOperation();
    $genderBiddableAdGroupCriterionOperation->setOperand($genderBiddableAdGroupCriterion);
    $genderBiddableAdGroupCriterionOperation->setOperator(Operator::SET);
    $operations[] = $genderBiddableAdGroupCriterionOperation;   

    $result = $adGroupCriterionService->mutate($operations);