Google My Business API Sync

Author
Riya Singh Author
|
1 week ago Asked
|
12 Views
|
2 Replies
0

We're trying to optimize our Google My Business API integration for client location data synchronization.

However, we're encountering an intermittent LOCATION_DATA_MISMATCH error when updating certain fields via the Business Profile API using the PATCH method.

Specifically, the addressLines array seems to be the culprit, even when passing what appears to be valid, canonicalized data.

Here's a simplified error log snippet we're seeing:

{  "error": {    "code": 400,    "message": "Request contains an invalid argument.",    "status": "INVALID_ARGUMENT",    "details": [      {        "@type": "type.googleapis.com/google.rpc.BadRequest",        "fieldViolations": [          {            "field": "location.address",            "description": "LOCATION_DATA_MISMATCH"          }        ]      }    ]  }}

Has anyone else navigated this LOCATION_DATA_MISMATCH specifically with addressLines updates through the Google My Business API? Any insights on handling address canonicalization or potential API quirks would be greatly appreciated.

2 Answers

0
MD Alamgir Hossain Nahid
Answered 1 week ago
I understand how frustrating these `LOCATION_DATA_MISMATCH` errors can be; we've definitely navigated similar issues with address synchronization in the past. Here are a few common causes and solutions:
  • Address Canonicalization: The API is very strict. Even minor deviations (e.g., 'St.' vs 'Street', 'Apt' vs '#') can trigger this. Ensure you're using a robust address validation service (e.g., Google's Geocoding API, Loqate, Melissa Data) to standardize the address before sending it to the Business Profile API. Sometimes, simply retrieving the existing address via a GET request and then using that exact format for subsequent PATCH operations can help, even if you only intend to update a different field.
  • languageCode Field: Verify that the languageCode you're providing in the Location object (or the request header) matches the locale of the address you're sending. Inconsistencies here can sometimes lead to validation issues, especially with international addresses.
  • Partial Updates & updateMask: While you're using PATCH, ensure your updateMask explicitly includes location.address if you're modifying any part of the address. If you're only updating addressLines, ensure the entire PostalAddress object is correctly formed and sent, even if only one line changes.
  • Geocoding Discrepancy: Occasionally, the LOCATION_DATA_MISMATCH can indicate that Google's internal geocoding services are interpreting your provided address differently than what's already on record or what it considers canonical. If you're consistently failing, try updating the address manually via the GBP dashboard first, then retrieve that canonicalized version via the API and use it for future programmatic updates.
0
Riya Singh
Answered 1 week ago

Ah got it, using the existing address format before updating really helped with the mismatch. But now the API is randomly returning 404s for some locations that definitely exist.

Your Answer

You must Log In to post an answer and earn reputation.