Unknown exception with error: Unmarshalling Error: Not a number

140 views
Skip to first unread message

ETERNA

unread,
Jun 15, 2020, 5:03:52 AM6/15/20
to AdWords API and Google Ads API Forum
Greetings, i’m trying to add proximity target location with radius to campaign using Ruby, to achieve this i use CampaignCriterionService with 

campaign_criteria = [
  { xsi_type: 'Proximity', radius_distance_units: 'kilometers', radius_in_units: 1.5, geo_point: { latitude_in_micro_degrees: 25.0428993, longitude_in_micro_degrees: 121.5688675 } }
]

operations = campaign_criteria.map do |criterion|
  { operator: 'ADD',
    operand: {
      campaign_id: campaign_id,
      criterion: criterion}
  }

but face such error - AdsCommon::Errors::ApiException: Unknown exception with error: Unmarshalling Error: Not a number: 25.0428993

i didn't find here in which format i should pass geo_point to proximity object:

any help will appreciate

Google Ads API Forum Advisor Prod

unread,
Jun 15, 2020, 1:16:38 PM6/15/20
to etern...@gmail.com, adwor...@googlegroups.com

Hi ETERNA,

Thank you for reaching out. latitudeInMicroDegrees and longitudeInMicroDegrees would require you to convert the decimal number to int number. To fix the issue, you could multiply the decimal value by 1,000,000 and round to the nearest integer value.

Thanks and regards,
Xiaoming, Google Ads API Team



 

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