Hi Dave,

Thanks for your reply.

Is this a limitation of Google Ads API that should be considered? Because I 
can do this with the following report definition in AdWords API:
{
    'reportName': 'Custom Report',
    'dateRangeType': 'TODAY',
    'reportType': 'GEO_PERFORMANCE_REPORT',
    'downloadFormat': 'CSV',
    'selector': {
'fields': ['CampaignName', 'Impressions', 'Clicks', 'CountryCriteriaId', 
'CityCriteriaId']
    }
}
which returns impressions and clicks segmented by city, filtered by today 
date range.

If this API limitation can't be overcome in current version, is there any 
other way to apply date filter to geographic_view with 
segments.geo_target_city?

On Friday, March 29, 2019 at 4:09:40 AM UTC+7, Nam Nguyen wrote:
>
>
> Hi,
>
> (I'm using Google Ads API v1)
> I've read that segments.geo_target_city can't be selected with 
> segments.date (
> https://developers.google.com/google-ads/api/docs/fields/segments#segmentsgeo_target_city
> )
> However, using segments.date seems to be the only way to specify date 
> range in Google Ads API (
> https://developers.google.com/google-ads/api/docs/query/date-ranges)
>
> If I run the query without segments.date, it returns all my campaigns.
> I can add segments.week but that's not what I need.
>
> In AdWords API, this can be achieved (
> https://developers.google.com/adwords/api/docs/appendix/reports/geo-performance-report#date
> )
>
> Below is the log
> -------
> Method: /google.ads.googleads.v1.services.GoogleAdsService/Search
> Host: googleads.googleapis.com:443
> Headers: {
>   "developer-token": "REDACTED",
>   "login-customer-id": "*********",
>   "x-goog-api-client": "gl-python/3.6.8 grpc/1.18.0 gax/1.7.0 gapic/1.1.1"
> }
> Request: {
>   "customerId": "**********",
>   "query": "SELECT metrics.clicks, metrics.impressions, 
> segments.geo_target_city FROM geographic_view WHERE metrics.impressions > 0 
> AND segments.date DURING TODAY LIMIT 100",
>   "pageSize": 1000
> }
>
> Response
> -------
> Headers: {
>   "google.ads.googleads.v1.errors.googleadsfailure-bin": 
> "\np\n\u0002(\u001f\u0012jThe following pairs of fields may not be selected 
> together: 'segments.geo_target_city' and 'segments.date'",
>   "grpc-status-details-bin": "\b\u0003\u0012%Request contains an invalid 
> argument.\u001a\u0001\
> nCtype.googleapis.com/google.ads.googleads.v1.errors.GoogleAdsFailure\u0012r\np\n\u0002(\u001f\u0012jThe
>  
> <http://nCtype.googleapis.com/google.ads.googleads.v1.errors.GoogleAdsFailure%5Cu0012r%5Cnp%5Cn%5Cu0002(%5Cu001f%5Cu0012jThe>
>  
> following pairs of fields may not be selected together: 
> 'segments.geo_target_city' and 'segments.date'",
>   "request-id": "RSGT-rPdBugjlbJPK0sYFg"
> }
> Fault: {
>   "errors": [
>     {
>       "errorCode": {
>         "queryError": "PROHIBITED_FIELD_COMBINATION_IN_SELECT_CLAUSE"
>       },
>       "message": "The following pairs of fields may not be selected 
> together: 'segments.geo_target_city' and 'segments.date'"
>     }
>   ]
> }
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/8f8c9b35-ca33-44d5-b06a-4f382870b79b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • How to ... Nam Nguyen
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
    • Re... Nam Nguyen
      • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
    • Re... Nam Nguyen
      • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
      • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to