Cost_micros way higher than expected.

272 views
Skip to first unread message

Alex Long

unread,
Apr 13, 2022, 1:51:32 PM4/13/22
to Google Ads API and AdWords API Forum

Hello,

I am currently building an ETL pipeline using the new Google Ads API

We were previously using the Adwords API. I am able to successfully pull data down using the API, but the cost_micros is showing with either 0 value or 6 digits.


See attached picture. Is this a currency issue? How do I specify US dollars as default?
Screenshot 2022-04-13 135053.png

Alex Long

unread,
Apr 13, 2022, 3:40:54 PM4/13/22
to Google Ads API and AdWords API Forum
query = f"""

SELECT
segments.date,
customer.id,
customer.descriptive_name,
campaign.id,
campaign.name,
campaign.status,
ad_group.id,
ad_group.name,
ad_group.status,
ad_group_ad.ad.name,
ad_group_ad.ad.id,
ad_group_ad.status,
segments.ad_network_type,
segments.device,
metrics.impressions,
metrics.clicks,
metrics.all_conversions,
metrics.all_conversions_value,
metrics.conversions,
metrics.conversions_value,
metrics.cost_micros,
metrics.absolute_top_impression_percentage,
metrics.view_through_conversions,
metrics.video_views,
metrics.video_quartile_p100_rate,
metrics.video_quartile_p25_rate,
metrics.video_quartile_p50_rate,
metrics.video_quartile_p75_rate,
metrics.active_view_impressions

FROM ad_group_ad
WHERE segments.date BETWEEN '{start_date}' AND '{stop_date}' """

Colin Lee

unread,
Apr 14, 2022, 1:07:55 PM4/14/22
to Google Ads API and AdWords API Forum
The metrics.cost_micros field is in micros, and you will need to divide by 1,000,000 to get the actual cost value.

Google Ads API Forum Advisor

unread,
Apr 15, 2022, 2:47:02 PM4/15/22
to adwor...@googlegroups.com
Hello,

As Colin indicated, the value is being returned in micros, which is 1,000,000 times the account currency. This is briefly discussed in the AdWords API documentation, though the concept applies to the Ads API as well. 

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2a2xQv:ref
Reply all
Reply to author
Forward
0 new messages