Performance metrix

30 views
Skip to first unread message

maxcode ITSolutions

unread,
Jun 6, 2023, 5:22:48 AM6/6/23
to Google Ads API and AdWords API Forum
Hi,

I have two queries to now about
1) I need to get campaigns clicks, cost etc. for today(or a particular date) on hourly basis something like the below image performancegraph.png, I have attached.

2) How I can I get total cost , total clicks of a campaign between two dates?


performancegraph.png

Google Ads API Forum Advisor

unread,
Jun 9, 2023, 4:48:38 AM6/9/23
to maxcodeit...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out to Google Ads API Forum.



1) I need to get campaigns clicks, cost etc. for today(or a particular date) on hourly basis something like the below image performancegraph.png, I have attached.

>> You may try segmenting your query by segments.hour together with adding filter segments.date in the Campaign report. 

Sample query:

SELECT 
  metrics.clicks, 
  metrics.cost_micros, 
  segments.hour 
FROM campaign 
WHERE 
  segments.date = {specific date}' 


2) How I can I get total cost, total clicks of a campaign between two dates?
>> You may try adding the two dates in your segments.date filter and use the BETWEEN operator. 

SELECT 
  metrics.cost_micros, 
  metrics.clicks 
FROM campaign 
WHERE 
  segments.date BETWEEN '{date1}' AND '{date2}' 

You may also refer to the Google Ads Query Language Grammar guide for more information on the Google Ads Query Language grammar reference.

Let us know how it goes. If you encounter issues after trying the suggested solution, then you may provide to us the complete API logs (request and response with request-id and request header) generated on our end so we can investigate further. You can provide it via the Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Links included in this email:

 

This message is in relation to case "ref:_00D1U1174p._5004Q2m9owd:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages