GAQL get cost by customer

153 views
Skip to first unread message

Maximiliano Wrzesinski

unread,
Jul 19, 2023, 9:07:36 AM7/19/23
to Google Ads API and AdWords API Forum
hi google team!

Im trying to get the metric.cost_micros but no by campaign, i would like to get it by customer, get the cost per customer.

Is it posible to get it without SUM an iteraction of one by one campaign metric_cost_micros ?

thanks

Max

Google Ads API Forum Advisor

unread,
Jul 19, 2023, 11:39:45 AM7/19/23
to adwor...@googlegroups.com

Hi Max, 

Thank you for reaching out to Google Ads API Forum.

I understand that you want to retrieve the cost metrics by customer and not by campaign. You may refer to the customer report (https://developers.google.com/google-ads/api/fields/v14/customer). If you are referring to something else, could you share with us the UI screenshot (without cropping) showing the data you are trying to retrieve? I am asking this since the API mirrors the UI and by checking, our team could provide more appropriate guidance on the corresponding report or query for retrieving the data.

You may then send the requested information privately via the Reply to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead. 

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

Thanks,
 
Google Logo Google Ads API Team


Maximiliano Wrzesinski

unread,
Jul 19, 2023, 12:09:57 PM7/19/23
to Google Ads API and AdWords API Forum
hi!

yes, you are correct,   i want cost metrics by customer and not by campaign

Maximiliano Wrzesinski

unread,
Jul 19, 2023, 12:21:49 PM7/19/23
to Google Ads API and AdWords API Forum
hi again.

Im checking the customer report link you sent me and i can't find any possible query to get the metric cost by customer directly with one simple query.

maybe if the answer is "no", is it possible in GAQL do a select sentence into another select sentence like mysql to get the SUM of the metric campaign cost by customer?

thanks

Max

Google Ads API and AdWords API Forum

unread,
Jul 19, 2023, 5:47:13 PM7/19/23
to Google Ads API and AdWords API Forum
Re-posting the last inquiry (https://groups.google.com/g/adwords-api/c/RDZM2sZJCIc) from the forum as it wasn't routed to our support queue.

Regards,
Google Ads API Team

Google Ads API and AdWords API Forum

unread,
Jul 20, 2023, 8:42:22 AM7/20/23
to Google Ads API and AdWords API Forum
Hi Max,

Thank you for returning to our team.

Regarding your concern, please note that the customer report (https://developers.google.com/google-ads/api/fields/v14/customer) pulls/retrieves data of a specific account. Having said that, since you want to pull the cost data, then you may try using the below query and let us know how it goes. Also, note that the specific field for cost in the Google Ads API is the metrics.cost_micros (https://developers.google.com/google-ads/api/fields/v14/customer#metrics.cost_micros) field.

  • SELECT customer.id, customer.descriptive_name, metrics.cost_micros FROM customer

If this doesn't pull your expected data, then you may send us the uncropped Google Ads UI screenshot showing the data that you wish to retrieve via the Google Ads API. You may then send the requested logs via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,
Google Ads API Team
On Thursday, July 20, 2023 at 12:21:49 AM UTC+8 m...@guildin.com wrote:

Maximiliano Wrzesinski

unread,
Jul 20, 2023, 10:21:09 AM7/20/23
to Google Ads API and AdWords API Forum
hi! thanks for your answer. 

Working fine! thanks for your help. 
Reply all
Reply to author
Forward
0 new messages