Hi, Thank you for getting back to us. I hope that you are doing well today.
I understand your concern and as mentioned here in this document <https://developers.google.com/google-ads/api/docs/reporting/segmentation#rules_for_core_date_segment_fields>, the segments.date, segments.week, segments.month, segments.quarter, and segments.year can be filtered in the WHERE clause without appearing in the SELECT clause. However, to further investigate the issue, could you please provide us the complete request <https://developers.google.com/google-ads/api/docs/concepts/field-service#request> and response <https://developers.google.com/google-ads/api/docs/concepts/field-service#response> logs with request ID <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id> and request header <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request_headers> generated on your end? You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsapi-supp...@google.com. If you haven't enabled the logging yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link <https://developers.google.com/google-ads/api/docs/client-libs?hl=en>. Kind regards, Google Ads API On Tuesday, April 18, 2023 at 8:04:14 PM UTC+8 Google Ads API and AdWords API Forum wrote: > Re-posting the last inquiry ( > https://groups.google.com/g/adwords-api/c/Yfsqi2GGHco) from the forum as > it wasn't routed to our support queue. > > Regards, > Google Ads API Team > On Tuesday, April 18, 2023 at 5:04:28 PM UTC+8 yaa...@rivery.io wrote: > >> Hi Google Ads API team! >> I am not sure what is the issue, but the docs that were sent are stating >> that the query is valid, just like the Query Validator screenshot I >> attached in the first message shows. >> Having the *segments.date* field in the WHERE clause is valid, and when >> I add the *segments.date* field to the SELECT clause, the validator >> shows it is valid too - but executing the API request retrieves no data >> when including it in the SELECT clause. >> I am not sure what the problem is here and would love your assistance in >> resolving it. >> If more information needs to be provided - please let me know what I >> should add to resolve it. >> >> On Monday, April 17, 2023 at 4:41:39 PM UTC+3 Google Ads API and AdWords >> API Forum wrote: >> >>> Hi, >>> >>> Thank you for raising this issue to the Google Ads API support team. >>> >>> Regarding your concern, you mentioned that you are getting empty results >>> using the above query but when you remove the *segments.date* from the >>> Select clause, you are able to get data. Having said that, I would suggest >>> referring to our *Segmentation* and *Rules for segments in the WHERE >>> clause* guides as this contains more details about this. >>> >>> Links included in this email: >>> >>> - *Segmentation - * >>> https://developers.google.com/google-ads/api/docs/reporting/segmentation >>> - *Rules for segments in the WHERE clause - * >>> >>> https://developers.google.com/google-ads/api/docs/reporting/segmentation#rules_for_segments_in_the_where_clause >>> >>> >>> Regards, >>> Google Ads API Team >>> On Monday, April 17, 2023 at 7:49:36 PM UTC+8 yaa...@rivery.io wrote: >>> >>>> This query fails to retrieve data, even though it gets a 200 >>>> status_code when executing in Python: >>>> >>>> url= ' >>>> https://googleads.googleapis.com/v12/customers/XXXXXX/googleAds:search' >>>> params_search= {"query": "SELECT customer.descriptive_name, customer.id, >>>> campaign.name, campaign.id, ad_group.name," >>>> " ad_group.id, metrics.impressions, metrics.clicks, >>>> metrics.conversions, " >>>> "metrics.cost_micros, ad_group_ad.ad.id, ad_group_ad.ad.name, >>>> segments.date FROM ad_group_ad " >>>> "WHERE segments.date >= '2022-12-25' AND segments.date <= '2023-04-14'" >>>> , >>>> "page_size": 10000} >>>> >>>> Here's the text response to this API request: >>>> ' >>>> { >>>> "fieldMask": "customer.descriptiveName,customer.id,campaign.name, >>>> campaign.id >>>> ,adGroup.name,adGroup.id,metrics.impressions,metrics.clicks,metrics.conversions,metrics.costMicros, >>>> adGroupAd.ad.id,adGroupAd.ad.name,segments.date" >>>> } >>>> ' >>>> >>>> When I removed the *segments.date* from the Select clause, the API >>>> request retrieves data back successfully. >>>> >>>> This shows that it is a valid API request in the Query Validator: >>>> [image: Untitled.png] >>>> >>>> >>>> Is there a problem using *segments.date* in the select clause, or is >>>> it possible that there's just no data for the *segments.date* for >>>> these time frames, or something else? >>>> >>> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 "Google Ads API and AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/d04d86a3-febb-4160-a04c-88de443fe03bn%40googlegroups.com.