Unable to segment campaign report by geo_target_country

1,643 views
Skip to first unread message

Sergiy Kovalchuk

unread,
Jan 15, 2020, 3:56:06 PM1/15/20
to AdWords API and Google Ads API Forum
Hello,
I am trying to pull a campaign performance by country from Google Ads API v2:

    SELECT 

        segments.geo_target_country,

        campaign.id,

        metrics.cost_micros

    FROM campaign


This gives me an error:
GA Request "RDMY8ywGvLXR0B-4IbC5vQ" failed with status "INVALID_ARGUMENT":
Cannot select or filter on the following segments: 'segments.geo_target_country'(could not support requested resources: 'CAMPAIGN'), since segment is incompatible with the resource in the FROM clause or other selected segmenting resources.

If I swap "geo_target_country" for "device" for example it works fine, so the problem is specifically with geo segmentation. Other geo related segments (state, city, etc) don't work either. Maybe geo segmentation needs to be enabled first for our accounts?

Thanks.

Google Ads API Forum Advisor Prod

unread,
Jan 15, 2020, 4:49:26 PM1/15/20
to ser...@gmail.com, adwor...@googlegroups.com
Hi Sergiy,

Thank you for reaching out. If you go to the campaign report page, there is a dropdown menu that says "Is campaign specified in the FROM clause of your query?" (see screenshot attached). If you select yes, you will see that segments.geo_target_country is no longer available. This indicates that it is not compatible with campaign when it is in the FROM clause.

The only report that supports this segment when it is in the FROM query is the Hotel Performance View report. I have submitted a feature request for this on your behalf so please keep an eye on our Developer Blog for information on future releases.

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5001USwaId:ref
campaign_doc.png

Inbar

unread,
May 27, 2021, 4:57:37 AM5/27/21
to AdWords API and Google Ads API Forum
Hi,

Is there any news about segmenting campaigns cost by country?
The Hotel Performance view has no Campaign id field

thanks

Google Ads API Forum Advisor Prod

unread,
May 27, 2021, 2:32:25 PM5/27/21
to inbar....@similarweb.com, adwor...@googlegroups.com
Hello,

This feature is still not available in the API. We will update this thread when it becomes supported.

Regards,
Anthony

Google Logo
Anthony
Google Ads API Team
 
 

ref:_00D1U1174p._5001USwaId:ref

Mike Sullivan

unread,
Aug 10, 2021, 10:40:02 AM8/10/21
to AdWords API and Google Ads API Forum
Just adding 'me, too' to this thread. The Ads API is also missing segment by region or city or other geo_target_* segments, even though they are selectable_with ad_group and campaign resources.  That is a pretty significant reporting limitation for some people.

m

Google Ads API Forum Advisor

unread,
Aug 11, 2021, 8:24:11 AM8/11/21
to mike.3....@gmail.com, adwor...@googlegroups.com
Hi Mike,

Would geographic_view segmenting by campaign and/or ad group work for you?

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Lm1k3:ref

Zhe Lin

unread,
Feb 27, 2025, 12:18:26 AMFeb 27
to Google Ads API and AdWords API Forum
Sorry for reopen it after so many years. I recently checked geographic_view and found it does not seem to work together with age_range. I know there is an age_range_view, but is there a way to segment campaign data by both geo_target_xxx and age_range at once ?

Google Ads API Forum Advisor

unread,
Feb 27, 2025, 5:20:49 AMFeb 27
to zhe...@leadplus.co.jp, adwor...@googlegroups.com
Hi,

Can you confirm whether you are trying to retrieve the geographic_view and age_range_view data in one single report? If yes, kindly note that both the geographic_view and age_range_view reports are different from one another and these cannot be fetched in a single report in the Google Ads API. This guide provides a set of Google Ads Query Language queries that demonstrate how to return the same data as screens in the Google Ads UI. Can you confirm whether your requirement is possible to fetch the data from the Google Ads UI? If yes, I would request you to provide an uncropped UI screenshot of the Google Ads account (with visible customer ID) by highlighting the fields and metrics for which you want to fetch the data from the Google Ads API. 
 

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-02-27 10:20:00Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02Lm1k3:ref" (ADR-00075283)



Zhe Lin

unread,
Feb 27, 2025, 9:20:14 PMFeb 27
to Google Ads API and AdWords API Forum
Hi,

Thanks for your message.

Let me explain it.
  Suppose a campaign has 100 clicks
  By selecting from geographic_view I would see 30 clicks from users in Caniformia and 70 clicks in Washington;
                       and by age_range_view I would see 40 clicks from 20~29 yrs old users and 60 clicks from 30~39 yrs old;
  While what I really want is
        10 clicks from 20~29 yrs old in Caniformia
        20 clicks from 30~39 yrs old in Caniformia
        30 clicks from 20~29 yrs old in Washington
        40 clicks from 30~39 yrs old in Washington

More specific, I tried this GAQL

        SELECT
          campaign.id,
          segments.geo_target_city,
          segments.date,
          metrics.clicks
        FROM age_range_view WHERE segments.date BETWEEN "2024-10-01" AND "2024-10-02" AND metrics.impressions > 0

It does not work and results in an error
"select or filter on the following segments: 'segments.geo_target_city'(could not support requested resources: 'AGE_RANGE_VIEW'), since segment is incompatible with the resource in the FROM clause"

I can hardly figure out why those segments are not compatible. Or should I try something else ?

Google Ads API Forum Advisor

unread,
Feb 28, 2025, 3:29:51 AMFeb 28
to zhe...@leadplus.co.jp, adwor...@googlegroups.com

Hi,

As per provided information, I understand that you are getting the PROHIBITED_SEGMENT_WITH_METRIC_IN_SELECT_OR_WHERE_CLAUSE error when trying to retrieve the data from the age_range_view resource. This error is encountered because a segment you have included together with a metric that it is incompatible with in the SELECT or WHERE clause. Please note that the segments.geo_target_city field is not supported with the age_range_view resource. I would recommend you to kindly refer to this age_range_view documentation that shows all metrics and segments that can be put in the same SELECT clause as the fields of age_rage_view. I would suggest you use the filter in the provided documentation to show only the fields that can be used when an age_rage_view resource is specified in the FROM clause. To assist you further with the geographic_view clicks data, please provide the Google Ads customer ID for better investigation.


Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-02-28 08:29:00Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02Lm1k3:ref" (ADR-00075283)



Reply all
Reply to author
Forward
0 new messages