How to exclude negative locations from location_view

34 views
Skip to first unread message

Mat

unread,
Jun 26, 2019, 12:03:06 PM6/26/19
to AdWords API and Google Ads API Forum
Hi,

how can I exclude negative locations from a location_view report?

My query:

  query = ('SELECT '
              'campaign.id, '
              'campaign.status, '
              'campaign.serving_status, '
              'campaign_criterion.negative, '
              'location_view.resource_name, '
              'metrics.clicks, '
              'metrics.cost_micros, '              
              'metrics.conversions '                                        
              'FROM location_view '
              'WHERE campaign.id = {} '
              'AND campaign_criterion.negative != TRUE '
              'AND campaign.status = ENABLED '
              'AND campaign.serving_status = SERVING '  
              'AND segments.date BETWEEN "{}" AND "{}"'.format(campaign_id, start,  end)
              )

... still returns excluded locations. What's wrong?

Regards
Mat

Google Ads API Forum Advisor Prod

unread,
Jun 27, 2019, 7:16:21 PM6/27/19
to m...@keyword-experte.de, adwor...@googlegroups.com
Hi,

You can exclude negative criteria from the results by adding campaign_criterion.negative = false to your query. The particular campaign in the query you provided does not have any negative location criteria, however.

Thanks,
Josh, Google Ads API Team

ref:_00D1U1174p._5001UCZdYE:ref

Mat

unread,
Jun 28, 2019, 4:59:53 AM6/28/19
to AdWords API and Google Ads API Forum
Hi Josh,

I beg your pardon? I did not provide any particular campaign in my query.
And as you can see, I've already added "'AND campaign_criterion.negative != TRUE '" to my query (which should yield the same results as "campaign_criterion.negative = false") . And still there are negative location criteria in the response - hence the question.

Regards
Mat

Google Ads API Forum Advisor Prod

unread,
Jun 30, 2019, 1:22:56 PM6/30/19
to m...@keyword-experte.de, adwor...@googlegroups.com
Hi Mat,

Sorry about that -- silly mistake on my part! I was looking into your question and a separate question at the same time and mixed up the campaign IDs.

I just ran a report against a campaign in another account with negative location criteria, and your filter of campaign_criterion.negative != TRUE resulted in negative criteria being excluded from the report. Could you share the campaign ID and date range for your report so I can check your exact case?
Reply all
Reply to author
Forward
0 new messages