googleads / google-ads-php

Google Ads API Client Library for PHP
https://developers.google.com/google-ads/api/docs/client-libs/php
Apache License 2.0
295 stars 262 forks source link

Summary row for each day #1049

Closed Abdullahbutt3434 closed 3 days ago

Abdullahbutt3434 commented 5 days ago

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? screenshot of Data below

image

How I want to display image

fiboknacky commented 3 days ago

Could you please ask in the Google Ads API forum since it's related to the way you use Google Ads API queries? Thanks.

Abdullahbutt3434 commented 3 days ago

I asked them but they said that's not possible. I don't know how these metrics are being calculated for each day I checked Looker Studio and DashThis they showing It graph.

fiboknacky commented 3 days ago

Since you've communicated with the team there, I'm closing this issue for now. If you still have unclear questions, please continue asking there.

But if you have a question regarding this client library itself, feel free to create a new one.