coveo.analytics 2.23.8 → 2.23.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.debug.js +56 -9
- package/dist/coveoua.debug.js.map +1 -1
- package/dist/coveoua.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/client/analytics.d.ts +1 -0
- package/dist/definitions/client/utils.d.ts +1 -0
- package/dist/definitions/insight/insightClient.d.ts +6 -1
- package/dist/definitions/insight/insightEvents.d.ts +17 -1
- package/dist/library.es.js +55 -5
- package/dist/library.js +56 -9
- package/dist/react-native.es.js +55 -5
- package/package.json +1 -1
- package/src/client/analytics.ts +24 -12
- package/src/client/utils.ts +3 -0
- package/src/coveoua/plugins.ts +1 -1
- package/src/coveoua/simpleanalytics.spec.ts +207 -125
- package/src/insight/insightClient.spec.ts +42 -0
- package/src/insight/insightClient.ts +31 -0
- package/src/insight/insightEvents.ts +33 -0
- package/src/searchPage/searchPageEvents.ts +5 -0
|
@@ -23,6 +23,8 @@ import {
|
|
|
23
23
|
InsightQueryErrorMeta,
|
|
24
24
|
InsightPagerMetadata,
|
|
25
25
|
InsightResultsSortMetadata,
|
|
26
|
+
UserActionsDocumentMetadata,
|
|
27
|
+
UserActionsPageViewMetadata,
|
|
26
28
|
} from './insightEvents';
|
|
27
29
|
|
|
28
30
|
export interface InsightClientProvider {
|
|
@@ -219,6 +221,35 @@ export class CoveoInsightClient {
|
|
|
219
221
|
return this.logCustomEvent(InsightEvents.expandToFullUI, metadataToSend);
|
|
220
222
|
}
|
|
221
223
|
|
|
224
|
+
public logOpenUserActions(metadata: CaseMetadata) {
|
|
225
|
+
const metadataToSend = generateMetadataToSend(metadata, false);
|
|
226
|
+
return this.logCustomEvent(InsightEvents.openUserActions, metadataToSend);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
public logShowPrecedingSessions(metadata: CaseMetadata) {
|
|
230
|
+
const metadataToSend = generateMetadataToSend(metadata, false);
|
|
231
|
+
return this.logCustomEvent(InsightEvents.showPrecedingSessions, metadataToSend);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
public logShowFollowingSessions(metadata: CaseMetadata) {
|
|
235
|
+
const metadataToSend = generateMetadataToSend(metadata, false);
|
|
236
|
+
return this.logCustomEvent(InsightEvents.showFollowingSessions, metadataToSend);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
public logViewedDocumentClick(document: UserActionsDocumentMetadata, metadata: CaseMetadata) {
|
|
240
|
+
return this.logCustomEvent(InsightEvents.clickViewedDocument, {
|
|
241
|
+
...generateMetadataToSend(metadata, false),
|
|
242
|
+
document,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
public logPageViewClick(pageView: UserActionsPageViewMetadata, metadata: CaseMetadata) {
|
|
247
|
+
return this.logCustomEvent(InsightEvents.clickPageView, {
|
|
248
|
+
...generateMetadataToSend(metadata, false),
|
|
249
|
+
pageView,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
222
253
|
public logDocumentOpen(info: PartialDocumentInformation, identifier: DocumentIdentifier, metadata?: CaseMetadata) {
|
|
223
254
|
return this.logClickEvent(
|
|
224
255
|
SearchPageEvents.documentOpen,
|
|
@@ -20,6 +20,26 @@ export enum InsightEvents {
|
|
|
20
20
|
* Identifies the event that gets logged when the user opens the full search page from the insight panel.
|
|
21
21
|
*/
|
|
22
22
|
expandToFullUI = 'expandToFullUI',
|
|
23
|
+
/**
|
|
24
|
+
* Identifies the event that gets logged when the user opens the user actions section.
|
|
25
|
+
*/
|
|
26
|
+
openUserActions = 'openUserActions',
|
|
27
|
+
/**
|
|
28
|
+
* Identifies the event that gets logged when the user clicks to view user action sessions preceding the ticket creation.
|
|
29
|
+
*/
|
|
30
|
+
showPrecedingSessions = 'showPrecedingSessions',
|
|
31
|
+
/**
|
|
32
|
+
* Identifies the event that gets logged when the user clicks to view user action sessions following the ticket creation.
|
|
33
|
+
*/
|
|
34
|
+
showFollowingSessions = 'showFollowingSessions',
|
|
35
|
+
/**
|
|
36
|
+
* Identifies the event that gets logged when the user clicks a viewed document link on the user actions timeline.
|
|
37
|
+
*/
|
|
38
|
+
clickViewedDocument = 'clickViewedDocument',
|
|
39
|
+
/**
|
|
40
|
+
* Identifies the event that gets logged when the user clicks a viewed page link on the user actions timeline.
|
|
41
|
+
*/
|
|
42
|
+
clickPageView = 'clickPageView',
|
|
23
43
|
}
|
|
24
44
|
|
|
25
45
|
export interface CaseMetadata {
|
|
@@ -33,6 +53,19 @@ export interface ExpandToFullUIMetadata extends CaseMetadata {
|
|
|
33
53
|
triggeredBy: string;
|
|
34
54
|
}
|
|
35
55
|
|
|
56
|
+
export interface UserActionsDocumentMetadata {
|
|
57
|
+
title: string;
|
|
58
|
+
uri: string;
|
|
59
|
+
uriHash?: string;
|
|
60
|
+
permanentId?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface UserActionsPageViewMetadata {
|
|
64
|
+
title: string;
|
|
65
|
+
contentIdKey: string;
|
|
66
|
+
contentIdValue: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
36
69
|
export interface InsightInterfaceChangeMetadata extends InterfaceChangeMetadata, CaseMetadata {}
|
|
37
70
|
|
|
38
71
|
export interface InsightFacetMetadata extends FacetMetadata, CaseMetadata {}
|
|
@@ -322,6 +322,11 @@ export const CustomEventsTypes: Partial<Record<SearchPageEvents | InsightEvents,
|
|
|
322
322
|
[SearchPageEvents.clearRecentResults]: 'recentlyClickedDocuments',
|
|
323
323
|
[SearchPageEvents.showLessFoldedResults]: 'folding',
|
|
324
324
|
[InsightEvents.expandToFullUI]: 'interface',
|
|
325
|
+
[InsightEvents.openUserActions]: 'User Actions',
|
|
326
|
+
[InsightEvents.showPrecedingSessions]: 'User Actions',
|
|
327
|
+
[InsightEvents.showFollowingSessions]: 'User Actions',
|
|
328
|
+
[InsightEvents.clickViewedDocument]: 'User Actions',
|
|
329
|
+
[InsightEvents.clickPageView]: 'User Actions',
|
|
325
330
|
[SearchPageEvents.caseDetach]: 'case',
|
|
326
331
|
};
|
|
327
332
|
|