Having issue with IpBlockInfo in latest version of GAds API

150 views
Skip to first unread message

Mitiz Technologies

unread,
Nov 1, 2021, 6:24:49 AM11/1/21
to AdWords API and Google Ads API Forum
Hi there,
We are using GAds API v8 in our application and we are facing problem while blocking IP address from the linked account. The accounts are linked successfully however if we are trying to block the IP address for any campaign using API, it throws error. Here is piece of code that we are using:

use Google\Protobuf\BoolValue;
use Google\Protobuf\StringValue;
use Google\Protobuf\Int64Value;
use Google\Protobuf\EnumValue;
use Google\Protobuf\DoubleValue;
use Google\ApiCore\ApiException;

$campaignResourceName = ResourceNames::forCampaign($adwords_user_id, $adwords_campaign_id);

$campaignCriterion = new CampaignCriterion([
'campaign' => new StringValue(['value' => $campaignResourceName]),
'type' => CriterionType::IP_BLOCK,
'ip_block' => new IpBlockInfo(['ip_address' => new StringValue(['value' => $ipAddress2])])
]);

We are seeing the following error:
code: 0
file: "public_html/adwords/google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php"
line: 96
message: "Expect string."
name: "Exception"
stack-trace: [,…]
type: "InvalidArgumentException"

################

Can you please look into this and suggest me to fix the issue? My Manager_Customer_Id is 9663159860.


Let me know if there is anything from my end.

Thanks!

Google Ads API Forum Advisor

unread,
Nov 2, 2021, 1:48:25 AM11/2/21
to miti...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for posting your concern.

Upon checking the provided logs, it appears that error has occurred because the PHP client library might not properly set up. With this, I would suggest to check the implementation of your client library by following this guide. If you have further questions / clarification about this, then I would suggest reaching out to the author of the client library via this link as they are more equipped to provide support to this kind of issue.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2QGsfH:ref

Mitiz Technologies

unread,
Nov 11, 2021, 3:08:30 AM11/11/21
to AdWords API and Google Ads API Forum
Hi,
I followed all instructions as suggested by GAds and the plugin author but they are saying to contact GAds team about the error we are getting. Here is the issue we have reported to plugin author:

Can you please look into this and suggest me any way to figure this out?

Let me know if you need any other information from my end.

Thanks!
Team Mitiz

Google Ads API Forum Advisor

unread,
Nov 11, 2021, 7:51:48 AM11/11/21
to miti...@gmail.com, adwor...@googlegroups.com
Hello,

Can you please provide us with the complete request and response logs associated with the invalid argument error?

Thanks,
Matt
Google Ads API Team


Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 
Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2QGsfH:ref
Reply all
Reply to author
Forward
0 new messages