AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

My Business
3.1K members online now
3.1K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

Update the location's coordinates

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

I would like to change the coordinates of a location by creating a patch, but I get this error:

[Google_Service_Exception]
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.mybusiness.v3.ValidationError",
"errorDetails": [
{
"code": 7,
"field": "latlng",
"message": "field is read only"
}
]
}
]
}
}

Is there a way to change the coordinates?

1 Expert replyverified_user

Re: Update the location's coordinates

Google Employee
# 2
Google Employee

Hi @Andrei C,

 

The latlng field for user-provided latitude and longitude is read-only and cannot be updated. This field is ignored if the provided address geocodes successfully when creating a location. This field is only present if the user-provided latlng value in a LatLng object was accepted when creating a new location via the API, or latlng value was updated through the Google My Business UI. You can drop a pin for your business location via the UI to provide the correct latitude and longitude coordinates. Please note that your edits may be reviewed for quality before being published.

 

If you have already created the location and you are sending a PATCH request to update the location via the API, please use a fieldMask and confirm that the fieldMask does not include address and latlng. You should provide latitude and longitude coordinates or fix the geocode error for your business location through the UI.

 

Thanks,

Terry