How are cost micros defined?

10,168 views
Skip to first unread message

Petra Manos

unread,
Jun 8, 2022, 4:29:38 AM6/8/22
to Google Ads Scripts Forum
Hi, I am getting strange output on cost micros and average cost. I am not understanding what units these are in.

I'm running a GAQL on the ad_group_audience_view report.

    "SELECT ad_group_audience_view.resource_name, ad_group.id, metrics.all_conversions_value, metrics.clicks, metrics.cost_micros, metrics.average_cost,  ad_group_criterion.status " +
    "FROM   ad_group_audience_view " +
    "WHERE  metrics.clicks > 0 " +
    "AND segments.date BETWEEN " + longTermDateFormatted + " AND " + todayDateFormatted);

The kind of data I get is as follows -

Resource Name - customers/4510250445/adGroupAudienceViews/134467879343~1652176653525

All conversion value
0

Clicks
32

Cost Micros 44647793

Average Cost
1395243.53125


As you can see the Cost Micros and the Average Cost are much much too high for only 32 clicks.

Can anyone tell me what these metrics are defined as please?

Google Ads Scripts Forum Advisor

unread,
Jun 8, 2022, 1:19:03 PM6/8/22
to adwords...@googlegroups.com
Hi Petra,

Thanks for reaching out. The unit, micros, is defined as 1,000,000 times the account currency. For example, $1.23 will be returned as 1230000, in micros. 

This is discussed in the AdWords API documentation (this API is deprecated but the discussion is still relevant).

Please let us know if you have any other questions.

Regards,

Google Logo
Matt
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2bdTCF:ref

Yan Victor Lahud

unread,
Jun 20, 2022, 6:15:37 AM6/20/22
to Google Ads Scripts Forum
Please, how i can do this in the code? This editian?

----
NOTIFICAÇÃO DE CONFIDENCIALIDADE: O conteúdo deste e-mail e seus anexos são para uso exclusivo do destinatário e podem conter informações confidenciais e/ou privilegiadas do Méliuz, sendo legalmente protegidas de divulgação não autorizada. Caso tenha recebido o e-mail por engano, notifique o remetente e apague-o de imediato.

Google Ads Scripts Forum Advisor

unread,
Jun 20, 2022, 11:57:33 AM6/20/22
to adwords...@googlegroups.com
Hello,

Can you please clarify your request?

Thanks,

Nils Rooijmans

unread,
Aug 18, 2022, 3:59:31 AM8/18/22
to Google Ads Scripts Forum
Hi Yan Victor,

You need to convert this micros value to your currency within your script. Here's a function you can use to do so:

// convert money data type to currency cost value
function convertMoney(m) {
  return m / 1000000;
}



Hope this helps,

Nils Rooijmans
https://nilsrooijmans.com
See my Google Ads Scripts FAQ to avoid the same mistakes I made: https://nilsrooijmans.com/google-ads-scripts-faq/

Reply all
Reply to author
Forward
0 new messages