i am using below code

$adGroupBidModifierService = $adWordsServices->get($session, 
AdGroupBidModifierService::class);

$operations = [];

// Prepare to add an ad group level override.
$adGroupBidModifier = new AdGroupBidModifier();
                //pr($adGroupBidModifier);
$adGroupBidModifier->setAdGroupId(67476925129);
$adGroupBidModifier->setCriterion(new AgeRange());
$adGroupBidModifier->getCriterion()->setId(503002);
$adGroupBidModifier->setBidModifier(1.5);
                //pr($adGroupBidModifier);

$operation = new AdGroupBidModifierOperation();

// Create an ad group bid modifier operation and add it to the list.
$operation->setOperator(Operator::SET);
$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.
try {                    
$result = $adGroupBidModifierService->mutate($operations);
                   // pr($result);
foreach ($result->getValue() as $adGroupBidModifier) {
$response[] = [
'ad_group_id' => $adGroupBidModifier->getAdGroupId(),
'criterion_id' => $adGroupBidModifier->getCriterion()->getId(),
'ad_group_level_modifier' => $adGroupBidModifier->getBidModifier()
];
}
return ['status' => true, 'message' => "Bid Modified", 'data' => $response];
} catch (ApiException $apiException) {
handleException($apiException);
}





gives CANNOT_BID_MODIFY_CRITERION_TYPE error


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/42b73ba6-141a-4e3b-bc0e-10a5b5c1e905%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • ... pinkesh singh
    • ... 'Peter Oliquino (AdWords API Team)' via AdWords API and Google Ads API Forum

Reply via email to