Grouping Data Google Ads Api

57 views
Skip to first unread message

Abdullah Butt

unread,
Oct 9, 2024, 1:22:50 PM10/9/24
to Google Ads API and AdWords API Forum
Hi,
I am working on Google Ads API  integration I need help.
I want to pull the data from API for a month with a filter
My query
SELECT metrics.average_cpm, segments.date FROM campaign WHERE campaign.name like '%CT-SK Display%' AND segments.date >= '2024-09-01' AND segments.date <= '2024-09-30'

This query will give me multiple records for each date
e.g for 1 Sep, it gives me 2 campaigns and also gives metric value for each campaign here I want to get the total of the metric for that day
I tried Summary Row with the result but it gives me the total metric value for the whole date range not for one date range.

I need to show the data in the graph for each day even if the user applied the filter on it.
I was adding all the values for each campaign but for metrics like metrics.average_cpm or CTR, it gives me the wrong value because we cannot sum up the percentage.

Is there any method or any way to get the total of each date despite having multiple values per day?
Thanks 

Google Ads API Forum Advisor

unread,
Oct 10, 2024, 1:52:41 AM10/10/24
to adwor...@googlegroups.com
Hi,

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

I understand that you would like to get the totals of the metrics for each date despite having multiple values per day.

Note that there is no feature in the Google Ads API that can help you achieve the result you needed. When the 'SUMMARY_ROW_WITH_RESULTS' is used in the search or searchStream methods, it will return summary row along with results. The summary row will be returned in the last batch alone (last batch will contain no results). The 'SUMMARY_ROW_ONLY' returns summary row only and returns no results.

I hope this clarifies.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGd3z:ref" (ADR-00271167)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages