GAQL date error

189 views
Skip to first unread message

alexande...@vogliomarketing.com

unread,
Jun 30, 2021, 2:32:05 PM6/30/21
to AdWords API and Google Ads API Forum

I'm trying to create the following GAQL query:

SELECT segments.product_item_id, ad_group.status, campaign.name, ad_group.name, segments.device, metrics.clicks, metrics.conversions, metrics.cost_micros, metrics.impressions, segments.date FROM shopping_performance_view WHERE segments.date DURING LAST_7_DAYS

However, both in my API calls and in the GAQL Query validator this query fails. Query validator gives the following error: "The filtering conditions in the WHERE clause must combine to form a valid, finite date range composed of the core date segments 'segments.date', 'segments.week', 'segments.month', 'segments.quarter', 'segments.year' if a core date segment is present in a query"

Why is DURING LAST_7_DAYS not considered a "valid, finite date range"? I have tried other date ranges take from examples such as: "segments.date BETWEEN '2019-01-01' AND '2019-01-31'" and I'm still getting the same error. According to this blog post: https://ads-developers.googleblog.com/2021/05/the-query-builder-blog-series-part-7.html
I would assume this to be a correct query. What am I missing?

Google Ads API Forum Advisor

unread,
Jul 5, 2021, 11:45:01 PM7/5/21
to alexande...@vogliomarketing.com, adwor...@googlegroups.com
Hi Alexander,

Thank you for reaching out to our API support team.

I tried your query using the query validator but was not able to replicate the issue you encountered. Could you share the complete screenshot when the issue occurred when using the query validator?

In addition, since you also mentioned encountering this in your API calls, could you share as well the complete request and response logs, with the request-id, generated when you encountered the issue? If you haven't 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.

You may then send all the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2JXdog:ref
Reply all
Reply to author
Forward
0 new messages