When working with the Google Ads API, we often encounter discrepancies between the numeric values returned by the API and the values displayed on the Google Ads UI. This difference arises because the API returns certain metrics and fields scaled by a factor of 1,000,000. To match the values visible in the Google Ads UI, these API responses need to be divided by 1,000,000.
Link to the google forum: Cost metric in Google ads api
Explanation of the Scaling
The scaling mechanism is a deliberate design choice made by Google Ads API. It is used to represent monetary values and other metrics with greater precision, avoiding issues with floating-point arithmetic. However, this also requires developers to apply appropriate scaling adjustments when interpreting API data.
For example:
-
If the API returns a value of 1000000 for a metric like Cost, the actual value displayed on the Google Ads UI will be 1.00.
-
Similarly, a value of 250000 returned by the API for Conversions will correspond to 0.25 when viewed on the UI.
The scaling by 1,000,000 in Google Ads API ensures high precision for monetary and other critical metrics. By dividing the returned values by 1,000,000, you can accurately map the API responses to the corresponding values in the Google Ads UI. Incorporate this scaling adjustment into your application logic to ensure consistency and accuracy when reporting or analyzing Google Ads data.
To give you a clearer understanding of the situation, let me use the Campaign view as an example.
When we query through the driver to retrieve data for a campaign, the API returns values that are scaled 1 million times larger than their actual values.

However, when viewing the same data in the Google Ads UI, the values are displayed correctly and remain fixed at their real values.

Additionally, to accurately observe the difference, I am providing a test that displays the calculated value in the result set.
The query used:
SELECT CLICKS, AllConversions, CampaignName, CostPerAllConversions, (CostPerAllConversions / 1000000) AS Real_Cost_Per_Convestion, CostMicros, (CostMicros /1000000) AS Real_Cost FROM "CData"."GoogleAds"."Campaign"
Result set:

Meanwhile, the values displayed in the UI:

Please reach out to [email protected] if this does not resolve the problem for you.