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 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/094cd6d4-a7c5-432f-a5a2-301b7f0a6817%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
