Date filters/ranges

659 views
Skip to first unread message

Miguel Angel Garcia

unread,
Jun 10, 2022, 2:42:47 PM6/10/22
to Google Ads API and AdWords API Forum
Is there a way to filter API reports by dates using ranges such as LAST 90 DAYS, LAST 12 MONTHS or ALL TIME? 

I know there are some predefined ranges (such as LAST_30_DAYS), but those are too limited for me. And putting specific dates manually is not an option. 

I'm using the API via a Google Sheet tool made by a third-party, so custom code to create those ranges is probably not an option either. 

I tried not filtering by date and instead limiting by number of records (for example, a limit of 90 records to show the last 90 days):

SELECT metrics.clicks, segments.date FROM customer ORDER BY segments.date DESC LIMIT 90

But that's an invalid query, apparently the API requires a filter with specific dates if I use the date segment. 

Any ideas?

Thanks!

Google Ads API Forum Advisor

unread,
Jun 12, 2022, 10:02:58 PM6/12/22
to delval...@gmail.com, adwor...@googlegroups.com
Hi Miguel,

Thank you for raising your concern to my team.

Please note that when you will not include a date range filter in the query, then the report is default to all time. As for the LAST 90 DAYS and LAST 12 MONTHS, I am afraid that there are no predefined values for those date ranges. With this, you will need to create custom date ranges instead for those date ranges. With this, I would suggest you reaching out to the support team of third-party tools that you are using to help you implement the custom date ranges in their tool.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


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