Hi Anil,
Thanks for reaching out to the Google Ads API Forum.
As per this guide in setting bid_modifier value, it mentions that the modifier must be in the range: 0.1 - 10.0. Also, Google Ads API is not specified to set bidModifier value to -1 in order to clear an existing bid modifier, and this is the reason your Google Ads API request fails. However, have you tried to add bid_modifier to the UpdateMask and not set a value in update?
Regards,
|
||||||
|
||||||
Uncaught Exception: Cannot convert '' to double
So empty specific field is not the correct option.
I did this
$bidModifierValue = "";
$campaignCriterion = new CampaignCriterion([
'resource_name' => ResourceNames::forCampaignCriterion(
$customerId,
$campaignId,
30001
),
'bid_modifier' => $bidModifierValue
]);
$campaignCriterion = new CampaignCriterion([
'resource_name' => ResourceNames::forCampaignCriterion(
$customerId,
$campaignId,
30001
)
]);
$CampaignCriterionOperation = new CampaignCriterionOperation();
$CampaignCriterionOperation->setUpdate($campaignCriterion);
$CampaignCriterionOperation->setUpdateMask(FieldMasks::allSetFieldsOf($campaignCriterion));
![]() |
Google Ads API Team |