What is cost_micros in Google Ads and how do you convert it?
Why Google Ads returns money in micros, how to convert it, and which other fields use the same unit.
Run a GAQL query for cost and the numbers look enormous: a campaign that spent 312.40 shows 312400000. That is not a bug. Google Ads returns money in micros.
What a micro is
One micro is one millionth of the account's currency unit.
- 1,000,000 micros = 1.00
- 312,400,000 micros = 312.40
The currency is the account's own; micros carry no currency information.
Converting
Divide by one million:
var rows = AdsApp.search(
"SELECT campaign.name, metrics.cost_micros FROM campaign " +
"WHERE segments.date DURING LAST_7_DAYS"
);
while (rows.hasNext()) {
var row = rows.next();
var cost = row.metrics.costMicros / 1000000;
Logger.log(row.campaign.name + ": " + cost.toFixed(2));
}Note the spelling: the query uses metrics.cost_micros, while the row object returned to a script uses row.metrics.costMicros.
Other fields in micros
Anything that is an amount of money: metrics.average_cpc, metrics.cost_per_conversion, campaign_budget.amount_micros, bid fields such as ad_group_criterion.cpc_bid_micros, and target CPA values.
Conversion value (metrics.conversions_value) is not in micros; it is already in currency units.
Going the other way
When a script sets a bid or a budget through a field that takes micros, multiply:
var bidMicros = Math.round(1.25 * 1000000);Round the result. Fractions of a micro are not accepted.
Common mistakes
- Comparing cost in micros with a threshold written in currency (
cost > 500), which is always true. - Calculating ROAS as conversion value divided by cost without converting the cost first.
- Converting twice.
GAQL Lab converts micros in its results table, so the numbers you see there are already in currency.