カスタム イベントでこのメソッドを呼び出して、分析を記録します。
構文
Microsoft.CIFramework.logAnalyticsEvent(data, eventName, correlationId).then(successCallback, errorCallback);
Parameters
| 件名 | タイプ | Required | Description |
|---|---|---|---|
| データ | JSON オブジェクト | 可 | JSON 入力 |
| eventName | String | 可 | イベントの名前 |
| correlationId | GUID | いいえ | 診断テレメトリのために関連するすべての API 呼び出しをグループ化するために使用されます。 |
| successCallback | Function | いいえ | プロミスが正常に返されたときに呼び出す関数。 |
| errorCallback | Function | いいえ | プロミス失敗を返すときに呼び出す関数。 |
data パラメーター JSON の構造は次のとおりです。 必ず次のフィールドを含めてください: conversationId と 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>"
}
]
}
]
}
値を返す
文字列としての値を持つプロミス
例
//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);