问题
So far this is what I have tried.
$adGroupCriterionService = $adWordsServices->get($session, AdGroupCriterionService::class);
$operations = [];
$devices = new Platform();
// $devices->setPlatformName('Desktop');
$devices->setId(30000);
// $devices->setId($app_id);
$biddableAdGroupCriterion = new BiddableAdGroupCriterion();
$biddableAdGroupCriterion->setAdGroupId(52012184360);
// $biddableAdGroupCriterion->setAdGroupId($adGroupId);
$biddableAdGroupCriterion->setCriterion($devices);
$biddableAdGroupCriterion->setBidModifier(1.5);
// $biddableAdGroupCriterion->setBidModifier($bid_adjustment);
$adGroupCriterionOperation = new AdGroupCriterionOperation();
$adGroupCriterionOperation->setOperand($biddableAdGroupCriterion);
$adGroupCriterionOperation->setOperator(Operator::SET);
$operations[] = $adGroupCriterionOperation;
$result = $adGroupCriterionService->mutate($operations);
I am having this error:
Fatal error: Uncaught Google\AdsApi\AdWords\v201710\cm\ApiException: [AdGroupCriterionError.CONCRETE_TYPE_REQUIRED @ operations[0].operand.criterion; trigger:'Criterion']
回答1:
You have to use AdGroupBidModifierService
instead.
https://developers.google.com/adwords/api/docs/guides/bidding#bid_modifiers
Ad group level adjustments are accessible via AdGroupBidModifierService.
Note: This section covers bid modifiers for Platform (campaign and ad group) [...]. For all OTHER criterion types, bid modifiers [...] are maintained via AdGroupCriterionService and specified via the bidModifier attribute of BiddableAdGroupCriterion.
来源:https://stackoverflow.com/questions/50056068/how-do-i-increase-decrease-mobile-bid-criteria-for-adgroups-for-google-adwords-a