getLocationHint getlocationhint

傳回 Experience Cloud Identity Service 地區 ID。地區 ID (或位置提示) 是特定 ID 服務資料中心之地理位置的數值識別碼。必須要有地區 ID,您才能對 Audience Manager 發出伺服器端 API 呼叫。

語法: var *變數名稱* = visitor.getLocationHint()

如需地區 ID 與對應位置的清單,請參閱 DCS 地區 ID、位置與主機名稱

程式碼範例

位置提示函數會從 AMCV Cookie 讀取地區 ID。如果 AMCV Cookie 中已設定地區 ID,則會立即進行回呼。若未設定地區 ID,則函數會先等待伺服器回應,再將地區 ID 傳至回呼。您的程式碼看起來可能類似於下列範例。

//callback function
var callback = function (
<i>region ID here</i>){
//do whatever your function does with the region ID
};

//Get the region ID
visitor.getLocationHint(callback, true);
recommendation-more-help
9c9e8ca9-9f7e-42c9-a5d5-a0d82776362a