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
1.4K members online now
1.4K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

API uploads new locations instead of updating the existing ones

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

A client of our agency decided to try out the API-solution here in Norway. The IT-team who worked on the script followed the given guidelines and the support they could get, but it still seems like something went wrong. They developed two scripts, one for regular opening hours and one for special opening hours. These scripts are supposed to roll out new information for updating the existing locations at 7 am the day after the information update. However, instead of updating the existing locations, the script creates a duplicate each time it runs, which means we've had a couple of rough clean ups in the GMB account and eventually had to stop the API and just go for the manual solution. The IT-team has cross-checked the script to see whether the command is upload instead of update, and tried to see where the error might be without any luck.  Since there are no support team for the API-solution, we were hoping maybe someone here could be able to help us out. So, anyone who experienced something similar or maybe someone who might come up with a solution?

1 Expert replyverified_user

API uploads new locations instead of updating the existing ones

Follower ✭ ✭ ✭
# 2
Follower ✭ ✭ ✭

Are you including the existing location ID's in your update payload? While I'm not too technical, anytime we've requested to make updates on GMB or other networks we manage for clients via API, you typically always have to pass the network an existing location ID so they don't treat it as a brand new location to be created in your account. 

Re: API uploads new locations instead of updating the existing ones

Google Employee
# 3
Google Employee

Hi @Michelle L,

 

According to your post, it sounds like you are creating a new location instead of sending a PATCH request to update the regularHours and specialHours for your location in Google My Business API. If the requestId is the same as the one used in a previously created location, the POST request for creating a new location under the specified account generates duplicate locations.

 

We suggest you please send a PATCH request with the locationId to update your location in Google My Business and make sure you always include a fieldMask for specific fields when you are updating a location to avoid overwriting data inadvertently.

 

I hope this helps!!

 

Thanks,

The Google My Business API team