AddCampaignBidModifier example. ApiException: Request contains an invalid argument

67 views
Skip to first unread message

Андрей Ласевичев

unread,
Dec 4, 2020, 8:40:16 AM12/4/20
to AdWords API and Google Ads API Forum
trying to repeat the example from github https://github.com/googleads/google-ads-php/blob/master/examples/CampaignManagement/AddCampaignBidModifier.php 
$campaignBidModifier = new CampaignBidModifier([
'campaign' => ResourceNames::forCampaign($customer_id, $campaign_id) ,
'bid_modifier' => '0.2',
'interaction_type' => new InteractionTypeInfo(
['type' => InteractionTypeEnum\InteractionType::CALLS]
)
/]);
/$campaignBidModifierOperation = new CampaignBidModifierOperation();
$campaignBidModifierOperation->setCreate($campaignBidModifier);

$campaignBidModifierService = $this->googleAdsClient->getCampaignBidModifierServiceClient();
$response = $campaignBidModifierService->mutateCampaignBidModifiers(
$customer_id,
[$campaignBidModifierOperation]
);

  Gives an error message: 
Fatal error: Uncaught Google\ApiCore\ApiException: { "message": "Request contains an invalid argument.", "code": 3, "status": "INVALID_ARGUMENT", "details": [ { "@type": "google.ads.googleads.v6.errors.googleadsfailure-bin", "data": "<Unknown Binary Data>" }, { "@type": "grpc-status-details-bin", "data": "<Unknown Binary Data>" }, { "@type": "request-id", "data": "AERI1ncjWWMKFKxUqRA2YQ" } ] }  

Андрей Ласевичев

unread,
Dec 14, 2020, 9:56:19 AM12/14/20
to AdWords API and Google Ads API Forum
Can you tell me how to fix the error? where did I go wrong?

пятница, 4 декабря 2020 г. в 18:40:16 UTC+5, Андрей Ласевичев:

Google Ads API Forum Advisor Prod

unread,
Dec 15, 2020, 2:52:49 AM12/15/20
to alase...@gmail.com, adwor...@googlegroups.com
Hello there,

Could you tell what protobuf version you're using and do you use the C implementation?
Note that we have a known issue that the PHP implementation may sometimes not work as expected.

Best,
Thanet, Google Ads API Team

ref:_00D1U1174p._5004Q28nD7b:ref

Андрей Ласевичев

unread,
Dec 15, 2020, 2:56:59 AM12/15/20
to AdWords API and Google Ads API Forum
Hello there! I am using  php_grpc-1.34.0rc2-7.3-ts-vc15-x64. Is this version working?

вторник, 15 декабря 2020 г. в 12:52:49 UTC+5, adsapiforumadvisor:

Google Ads API Forum Advisor Prod

unread,
Dec 15, 2020, 3:04:17 AM12/15/20
to alase...@gmail.com, adwor...@googlegroups.com
That's the gRPC version, not the protobuf version.
Could you please confirm the protobuf version and whether you're using the C implementation?
Please follow the link I provided for more information.

ref:_00D1U1174p._5004Q28nD7b:ref

Андрей Ласевичев

unread,
Dec 15, 2020, 3:35:30 AM12/15/20
to AdWords API and Google Ads API Forum
no, I don't have a С implementation. Now I will try to install the C implementation.

вторник, 15 декабря 2020 г. в 13:04:17 UTC+5, adsapiforumadvisor:
Reply all
Reply to author
Forward
0 new messages