Incorrect CPC. Money attribute

169 views
Skip to first unread message

vaibhav Yadav

unread,
Jul 10, 2017, 10:22:46 AM7/10/17
to AdWords API Forum
I am using TargetingIdeaService to find data for keywords such as bid value, search volume, cpc, etc.
I am getting correct search volume and ideas but i am getting incorrect cpc.
The output data for the keyword 'car' looks as follows :


cars for sale : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 86852622 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
used cars : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 121778649 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
new cars : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 111140170 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
car sales : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 16435437 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
used car sales : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 92384020 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
used cars for sale : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 139973717 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
new car prices : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 122150944 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
car search : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 115225122 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
used cars for sale near me : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 176359912 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
new cars for sale : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 185963380 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
compare cars : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 22170602 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
used car search : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 130319306 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
find a car : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 93113491 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
cars for sale near me : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 104996541 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
vehicles for sale : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 91463897 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
car websites : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 90903063 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 
cool cars : Google\AdsApi\AdWords\v201702\cm\Money Object ( [microAmount:protected] => 165872325 [ComparableValueType:protected] => [ComparableValue.Type] => Money ) 


I am not getting the value is dollars and i am not able to understand this string. Please help. Thankyou:)

Shwetha Vastrad (AdWords API Team)

unread,
Jul 10, 2017, 10:58:20 AM7/10/17
to AdWords API Forum
Hi Vaibhav, 

Fields of type Money are returned in micro currency units (micros). You need to divide this value by 1000000 to get the actual amount in the account's local currency.

Regards,
Shwetha, AdWords API Team.

Ricky Cortopassi

unread,
Jun 5, 2020, 4:41:49 PM6/5/20
to AdWords API and Google Ads API Forum
Hello, 
with the given examples above. 

- Micro amount = 130319306
- Converted Value = 130.319306 

the issue here, is that it seems most of the time , these converted values end up being , divisible and end up as actual single cent, 
but in the cases that it does not ( like above ) - should this be treated as $131.31 OR should it be treated as $130.32 or formatted to actual minimum currency unit.. 


 

Google Ads API Forum Advisor Prod

unread,
Jun 8, 2020, 12:49:05 PM6/8/20
to ricky.co...@dealereprocess.com, adwor...@googlegroups.com
Hi Ricky,

Thank you for reaching out to us. I see that you're wondering how the rounding works in the UI. I have observed from the UI that AdWords rounding off the values to lower bound when the number after the 2nd decimal is <=5 and round off to higher bound when the number after the 2nd decimal values >5. Which says when the micro amount is 2.98222 it will be rounded to 2.98, 2.9856 it will be rounded to 2.99 and when the number is 2.9855 then it will be rounded as 2.98. Hope this clarifies your concern. Please let me know if you have any further questions.

Thank you,
Bryan, Google Ads API Team

ref:_00D1U1174p._5004Q20Wctv:ref

Ricky Cortopassi

unread,
Jun 9, 2020, 8:26:54 AM6/9/20
to AdWords API and Google Ads API Forum
Thanks, for the update. However, the problem i seem to have is that these totals still don't add up and are sometimes still a penny off here, and a penny off there even when using the below for handling rounding.  

- for example, 
a campaign performance report that is segmented by device and day. ( over the course of lets say 60 days.. on 20X + campaigns ) some of these might be off when sum the totals cost by a penny or more when adding the full total.. 

I guess, another question would be , why this is not returned in the minimum currency unit all of the time? I was under the impression that micros were used to prevent the floating point representations . 

Ricky Cortopassi

unread,
Jun 9, 2020, 8:30:01 AM6/9/20
to AdWords API and Google Ads API Forum
This does also happen when sending data to the APi as well. ( however i was able to resolve this issue ) - 

for example sending 2.25 in micros. ( 2250000 ) 
* Error ( 224999 ) is not minimum currency unit. 

Google Ads API Forum Advisor Prod

unread,
Jun 9, 2020, 11:22:32 AM6/9/20
to ricky.co...@dealereprocess.com, adwor...@googlegroups.com

Hi Ricky,

I'm taking a closer look at this issue along with the example you've attached. Could you provide me with your account ID that holds these campaigns as well as the campaigns that show discrepancy so that I may further investigate this concern? For privacy, you can reply by using "reply privately to the author".



Thank you,
Bryan, Google Ads API Team



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