Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Gọi phương thức này để ghi nhật ký phân tích cho các sự kiện tùy chỉnh.
Cú pháp
Microsoft.CIFramework.logAnalyticsEvent(data, eventName, correlationId).then(successCallback, errorCallback);
Thông số
| Tên | Type | Bắt buộc | Description |
|---|---|---|---|
| dữ liệu | Đối tượng JSON | Có | Đầu vào JSON |
| tên sự kiện | Xâu | Có | Tên sự kiện |
| CorrelationId | GUID | Không | Được sử dụng để nhóm tất cả các lệnh gọi API liên quan lại với nhau để đo từ xa chẩn đoán. |
| successCallback | Chức năng | Không | Một hàm để gọi khi promise được trả về thành công. |
| errorCallback | Chức năng | Không | Một hàm để gọi khi yêu cầu trả về promise không thành công. |
Đây là cấu trúc của data tham số JSON. Đảm bảo bao gồm các trường: conversationId và providerSessionId.
{
"conversationId": "<Conversation identifier>",
"providerSessionId": "<Channel Integration Framework Provider Id>",
"clientSessionId":"<Client session identifier>",
"participantId":"<Participant identifier>",
"events": [
{
"kpiEventName": "<Name of the associated KPI event>",
"kpiEventReason": "<Reason due to which the KPI event was created>",
"eventTimestamp": "<Timestamp at which the event occurred>",
"additionalData": "<Additional data related to the session>",
"notificationResponseAction":"<Agent notification response action value>",
"externalCorrelationId": "<External system correlation Id>",
"customData": [
{
"attribute": "<name>",
"value": "<value>"
}
]
}
]
}
Giá trị trả về
Promise với giá trị dưới dạng chuỗi
Example
//Success callback handler
const successCallback = (result) => {
// result will indicate if the custom analytics event has been logged
console.log(result);
};
//Failure callback handler
const errorCallback = (error) => {
// handling failure
console.error(error)
};
Microsoft.CIFramework.logAnalyticsEvent(data, eventName, correlationId).then(successCallback, errorCallback);