Hi,

Thank you for giving us a detailed explanation of the issue. Unfortunately,
segments.geo_target_city and segments.date are not selectable with each
other in Google Ads API. You may refer to this link
<https://developers.google.com/google-ads/api/docs/fields/segments#segmentsgeo_target_city> to
see the fields that are selectable with segments.geo_target_city.

Let me know if you have any further concerns.

Regards,
Dave Paurillo
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 03/28/19 18:25:40 nt.nam.k54f...@gmail.com 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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
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
<https://groups.google.com/d/msgid/adwords-api/094cd6d4-a7c5-432f-a5a2-301b7f0a6817%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
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/19h8950000000001guiohe0018fp46x68mj8d9m60o30c1g68qjec9n%40mail.gmail.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