Some of my budget mutate requests get
NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT, most don't, and all the values
are rounded with 2 digits after the decimal point (well, converted to
microUnits afterwards, obviously)
Setting budget to 241.38 works, but setting another campaign's budget
to 259.71 won't work. Two different campaigns. First reqid is
63ee80f03c3f81471f23a12c04861069, and the second one is
5dfcf48d3f485c1ec6d3c4ab29b44670.
I actually wrote some exception handling code that, if it encounters
BudgetError.NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT the first time, it
will try again with a fully-rounded budget amount (260 instead of
259.71)
Again, the numbers are converted to microUnits (multiplied by 1000000)
before they are passed into the Money() constructor.
By the way I couldn't find any info about minimum money units in the
documentation. In fact, a clear documentation about microAmount/Money
and reference to it in the CampaignService.BudgetError page would be
really useful for new implementors.
Best,
Kemal
It looks like your second bid, 259.71, wasn't converted correctly:
<ns1:budget xsi:type="ns1:Budget">
<ns1:amount xsi:type="ns1:Money">
<ns1:microAmount>259709999</ns1:microAmount>
</ns1:amount>
</ns1:budget>
Are you using floats to store microAmount values?
Best,
- Eric Koleda, AdWords API Team
Integer casting yields to bad results. Never ever should cast
microAmounts to int in php5.
On Apr 5, 5:22 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
wrote: