Delen via


logAnalyticsEvent (JavaScript API-naslag) voor Dynamics 365 Channel Integration Framework 2.0

Roep deze methode aan om analyses voor aangepaste gebeurtenissen te registreren.

Syntaxis

Microsoft.CIFramework.logAnalyticsEvent(data, eventName, correlationId).then(successCallback, errorCallback);

Parameterwaarden

Naam Typologie Verplicht Description
gegevens JSON-object Yes JSON-invoer
naam van het evenement String Yes Naam van het evenement
correlatie-id GUID (Globaal Unieke Identificatiecode) Nee. Wordt gebruikt om alle gerelateerde API-aanroepen te groeperen voor diagnostische telemetrie.
succesTerugbellen Functie Nee. Een functie om aan te roepen wanneer de belofte met succes is teruggegeven.
foutCallback Functie Nee. Een functie om aan te roepen wanneer het verzoek om de belofte terug te sturen mislukt.

Hier is de structuur van de data parameter JSON. Zorg ervoor dat u de velden opneemt: conversationId en 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>"
				}
			]
		}
	]
}

Retourwaarde

Belofte met waarde als string

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);

updateGespreksmethode
Channel Analytics