Adding Positive Keywords and Location Names as Campaign Criterion in PHP

50 views
Skip to first unread message

Filip Pećanac

unread,
Oct 26, 2021, 5:25:38 AM10/26/21
to AdWords API and Google Ads API Forum
Hi, 

I am having two issues with using Google Ads API.

1. I am trying to add an array of Positive Keywords via Google Ads API, yet all I have figured out so far is how to add Negative Keywords.
2. When I try to add location as campaign criterion, I see that it can be done by adding Location ID, but I want to be able to type Location names.

Could you please assist me with this?

Thanks!

Google Ads API Forum Advisor

unread,
Oct 26, 2021, 3:15:17 PM10/26/21
to filip....@oneassessment.com, adwor...@googlegroups.com
Hi Filip,

You can only exclude keywords at the campaign level, so you must specify negative = true on a keyword's CampaignCriterion.

At the ad group level, you can either target or exclude keywords. Here's AddKeywords.php.

You can use the geo_target_constant or download the latest CSV of geotargets to get location Id's.

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2QFFGG:ref

Google Ads API Forum Advisor

unread,
Oct 27, 2021, 10:10:32 PM10/27/21
to filip....@oneassessment.com, adwor...@googlegroups.com

Hello Filip,

Thanks for getting back to us.

So our team can take a closer look on the error, can you share to us the complete API logs (request and response with request-id)? Since you're using the PHP client library, you can enable logging via this guide.

Please send the requested details via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,

Google Logo
Mark Kevin Albios
Google Ads API Team
 


ref:_00D1U1174p._5004Q2QFFGG:ref

Filip Pećanac

unread,
Oct 28, 2021, 5:22:38 AM10/28/21
to AdWords API and Google Ads API Forum
Hi

I have managed to fix this, so everything is fine.

Thanks for the assistance!

Regards,
Filip
Reply all
Reply to author
Forward
0 new messages