How can I use the api to check for campaigns that don't have loaction set?

38 views
Skip to first unread message

Jing CHEN

unread,
Jul 11, 2022, 8:05:50 AM7/11/22
to Google Ads API and AdWords API Forum
Hi,
How can I use the api to check for campaigns that don't have loaction set?

query = """SELECT campaign.id, campaign.name FROM campaign_criterion WHERE campaign.status IN ('ENABLED', 'PAUSED') AND campaign_criterion.type = 'LOCATION' AND campaign_criterion.location.geo_target_constant IS NULL"""

in this query, where statement campaign_criterion.location.geo_target_constant IS NULL does not work, it returns None directly.
regards

Google Ads API Forum Advisor

unread,
Jul 11, 2022, 1:46:30 PM7/11/22
to lakaen...@gmail.com, adwor...@googlegroups.com
Hi Jing,

Thank you for reaching out to the Google Ads API support team.

To investigate the issue further, could you please provide the complete request and response logs, with the request-id ? If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link. Can you please provide full screen screenshot of the UI of what you are looking for? You can provide it via Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead. Let me know if you have any questions.

Thanks,
Google Logo
Nirmitabahen Gaurav
Google Ads API Team
 


ref:_00D1U1174p._5004Q2cUjPT:ref

Jing CHEN

unread,
Jul 11, 2022, 10:02:14 PM7/11/22
to Google Ads API and AdWords API Forum
hi
I think there is no issue with this query, if geo_target_constant is null then naturally there is no campaign with campaign_criterion of LOCATION.
But my question is how to find this kind of campaign without setting the location through google ads api.
One way to do this is to iterate through the list of campaigns and pop up the ones that have a location from the list.
I was wondering if there is a simpler way to do this. Can you give me some advice?
regards


Google Ads API Forum Advisor

unread,
Jul 12, 2022, 12:49:09 AM7/12/22
to lakaen...@gmail.com, adwor...@googlegroups.com
Hi Jing,

Thank you for providing more details to your concern.

I can confirm that your understanding is correct about the filter that you've implemented. However, I am afraid that there is no direct way to get the list of the campaigns with no location criterion. You indeed need to get the list of the campaigns first by using the campaign report, get the list of the campaign with location using the query that you initially specified, then compare the 2 reports and derive the list of campaigns with no location there.

Let me know if you have further questions.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


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