為盡可能確保商家檔案準確無誤,Google 會採用多種來源的資訊,像是使用者回報和授權內容等。如果有人回報業主提供的資訊有誤,Google 會通知商家資訊擁有者。商家資訊擁有者可以接受或拒絕更新。
My Business Business Information API 可讓商家資訊擁有者查看這些更新,確保商家資訊正確無誤。本指南說明如何接受或拒絕更新。
如要管理 Google 資訊更新,請完成下列步驟:
尋找待更新的地點
接受或拒絕更新前,請先找出哪些地點有 Google 資訊更新。如要取得地點的 Google 資訊更新,最好的方法是使用 Cloud Pub/Sub 管理即時通知。如果 Pub/Sub 主題收到 GOOGLE_UPDATE 通知,表示有變更項目可供審查。通知中的 locationName 欄位會提供含有 Google 資訊更新的地點資源名稱。
或者,您也可以查看 locations.get 呼叫,並檢查 Metadata 是否有 hasGoogleUpdated 旗標。如果為 "isGoogleUpdated": true,則與這個位置相關聯的地點 ID 有更新。
要求
以下是 locations.get 要求範例:
GET
https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}
要求
以下是 locations.get 回應範例:
{
"name": "locations/{locationId}",
"title": "Test Business",
"phoneNumbers": {
"primaryPhone": "02 9374 4000"
},
...
"metadata": {
"hasGoogleUpdated": true,
...
}
...
}查看更新的欄位
如要查看有 Google 資訊更新的特定欄位,請呼叫 locations.getGoogleUpdated。
這個方法會在回應主體中傳回兩個重要遮罩:
diffMask:表示放送資料 (顧客在 Google 地圖和 Google 搜尋上看到的內容) 與當地偏好值不同的欄位。這通常是由 Google 資訊更新或使用者原創內容所造成。您必須接受或拒絕這些欄位,才能解決不一致的問題。pendingMask:表示你先前提交的更新仍在處理中,尚未推送至 Google 地圖和 Google 搜尋。您不需要對這些欄位採取任何行動。
要求
以下是 locations.getGoogleUpdated 要求範例:
GET
https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}:googleUpdated
回應
以下是 locations.getGoogleUpdated 回應範例。phoneNumbers.primaryPhone 欄位中顯示可用的更新。這項回應中的值就是建議的更新值:
{
"location": {
"name": "locations/{locationId}",
"locationName": "Test Business",
"phoneNumbers": {
"primaryPhone": "+1 111 111 1111"
},
...
},
"diffMask": "phoneNumbers.primaryPhone"
}接受或拒絕更新
如要解決 diffMask 中列出的欄位,您必須使用 locations.patch 要求接受或拒絕更新:
- 接受更新:使用
getGoogleUpdated回應中傳回的新值修補地點。這樣一來,本機記錄就會更新,與放送資料一致。 - 拒絕更新:使用原始偏好值修補地點。這會透過更新管道重新宣告偏好的資料,並覆寫服務資料。
無論是哪一種情況,請將 updateMask 設為涵蓋要解決的欄位。
接受要求
以下是 locations.patch 要求範例:
PATCH
https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}?updateMask=phoneNumbers.primaryPhone
{
"phoneNumbers": {
"primaryPhone": "+1 111 111 1111"
},
}
回應
以下是 locations.patch 回應範例:
{
"name": "locations/{locationId}",
"locationName": "Test Business",
"phoneNumbers": {
"primaryPhone": "+1 111 111 1111"
},
...
}拒絕要求
以下是 locations.patch 要求範例:
PATCH
https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}?updateMask=phoneNumbers.primaryPhone
{
"name": "locations/{locationId}",
"locationName": "Test Business",
"phoneNumbers": {
"primaryPhone": "222 222 2222"
},
...
}
回應
以下是 locations.patch 回應範例:
{
"name": "locations/{locationId}",
"locationName": "Test Business",
"phoneNumbers": {
"primaryPhone": "222 222 2222"
},
...
}查看結果
如果位置修補成功,locations.getGoogleUpdated 回應中的 diffMask 欄位會顯示 "diffMask": "" 值。此外,Metadata 中的 "hasGoogleUpdated" 標記會顯示 false 值,或不顯示任何值。
如果欄位值不清楚,請與支援團隊聯絡,並提供 getGoogleUpdated 的要求和回應。要求必須包含 locations.patch 呼叫、修補呼叫和 getGoogleUpdated 呼叫之前的回應。