Monthly and weekly data grouping

68 views
Skip to first unread message

Sebastián

unread,
Nov 30, 2023, 9:13:04 PM11/30/23
to Google Ads API and AdWords API Forum
Hey! i have a problem with the segments.month and segments.week, i need to bring data of metrics, grouped by month and by weeks

Something like this

clicks | month
250    | October
313    | November 

when i do this query "SELECT metrics.clicks FROM campaign WHERE segments.date BETWEEN '2023-09-01' AND '2023-11-01'" i get 5 rows, but when i add segments.month to the select i dont get anything:

SELECT metrics.clicks, segments.month FROM campaign WHERE segments.date BETWEEN '2023-09-01' AND '2023-11-01'

 Same thing happened when i tried with segments.week.

Although i found a way to bring the data by month doing a loop bringing the data from first day of the month until last day of the month, but it is not efficient cause if i need ten months, for example, i will have to do ten requests 

If someone can help me would be great! Thanks in advance


Google Ads API Forum Advisor

unread,
Dec 1, 2023, 12:12:23 PM12/1/23
to sebasti...@r1vs.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team. 

By reviewing your concern, I understand that you're encountering an issue where you can retrieve data when segmented by date, but you're facing difficulties retrieving data when segmented by month and week. In order to investigate your issue further, kindly provide us with the complete API logs (request and response logs with request-id and request header) generated at your end and uncropped UI screenshot of the Google Ads account where you are facing the issue.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02qW0wK:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages