setCustomerIDs

上次更新: 2023-05-26
  • 建立對象:
  • Developer
    User
    Admin
    Leader

setCustomerIDs 會設定 1 或多個機碼值組,定義客戶 ID 及其驗證狀態。

語法: visitor.setCustomerIDs()

如下列程式碼範例所示,您可以設定單一或多個 ID。如需詳細資訊和範例,請參閱客戶 ID 和驗證狀態

// Single ID with a single authentication state
visitor.setCustomerIDs({
    "userid":{
        "id":"67312378756723456",
        "authState":Visitor.AuthState.AUTHENTICATED
    }
});

//Multiple IDs with a single authentication state
visitor.setCustomerIDs({
    "userid":{
        "id":"67312378756723456",
        "authState":Visitor.AuthState.AUTHENTICATED
    },
    "dpuuid":"550e8400-e29b-41d4-a716-446655440000"
});

此頁面上的