coveo.analytics 2.26.5 → 2.26.6
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 +45 -1
- package/dist/coveoua.debug.js.map +1 -1
- package/dist/coveoua.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/insight/insightClient.d.ts +14 -1
- package/dist/definitions/version.d.ts +1 -1
- package/dist/library.es.js +45 -1
- package/dist/library.js +45 -1
- package/dist/react-native.es.js +45 -1
- package/package.json +1 -1
- package/src/insight/insightClient.spec.ts +268 -0
- package/src/insight/insightClient.ts +134 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnalyticsClient, ClientOptions } from '../client/analytics';
|
|
2
2
|
import { SearchEventRequest } from '../events';
|
|
3
|
-
import { DocumentIdentifier, FacetStateMetadata, PartialDocumentInformation, SearchPageEvents } from '../searchPage/searchPageEvents';
|
|
3
|
+
import { DocumentIdentifier, FacetStateMetadata, PartialDocumentInformation, SearchPageEvents, SmartSnippetDocumentIdentifier, SmartSnippetFeedbackReason, SmartSnippetLinkMeta, SmartSnippetSuggestionMeta } from '../searchPage/searchPageEvents';
|
|
4
4
|
import { ExpandToFullUIMetadata, InsightEvents, InsightFacetMetadata, InsightInterfaceChangeMetadata, InsightStaticFilterToggleValueMetadata, InsightFacetRangeMetadata, InsightCategoryFacetMetadata, CaseMetadata, InsightFacetSortMeta, InsightFacetBaseMeta, InsightQueryErrorMeta, InsightPagerMetadata, InsightResultsSortMetadata, UserActionsDocumentMetadata, UserActionsPageViewMetadata } from './insightEvents';
|
|
5
5
|
export interface InsightClientProvider {
|
|
6
6
|
getSearchEventRequestPayload: () => Omit<SearchEventRequest, 'actionCause' | 'searchQueryUid'>;
|
|
@@ -57,6 +57,19 @@ export declare class CoveoInsightClient {
|
|
|
57
57
|
logDocumentQuickview(info: PartialDocumentInformation, identifier: DocumentIdentifier, caseMetadata?: CaseMetadata): Promise<void | import("../events").ClickEventResponse>;
|
|
58
58
|
logCaseAttach(info: PartialDocumentInformation, identifier: DocumentIdentifier, caseMetadata?: CaseMetadata): Promise<void | import("../events").ClickEventResponse>;
|
|
59
59
|
logCaseDetach(resultUriHash: string, metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
60
|
+
logLikeSmartSnippet(metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
61
|
+
logDislikeSmartSnippet(metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
62
|
+
logExpandSmartSnippet(metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
63
|
+
logCollapseSmartSnippet(metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
64
|
+
logOpenSmartSnippetFeedbackModal(metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
65
|
+
logCloseSmartSnippetFeedbackModal(metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
66
|
+
logSmartSnippetFeedbackReason(reason: SmartSnippetFeedbackReason, details?: string, metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
67
|
+
logExpandSmartSnippetSuggestion(snippet: SmartSnippetSuggestionMeta | SmartSnippetDocumentIdentifier, metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
68
|
+
logCollapseSmartSnippetSuggestion(snippet: SmartSnippetSuggestionMeta | SmartSnippetDocumentIdentifier, metadata?: CaseMetadata): Promise<void | import("../events").CustomEventResponse>;
|
|
69
|
+
logOpenSmartSnippetSource(info: PartialDocumentInformation, identifier: DocumentIdentifier, metadata?: CaseMetadata): Promise<void | import("../events").ClickEventResponse>;
|
|
70
|
+
logOpenSmartSnippetSuggestionSource(info: PartialDocumentInformation, snippet: SmartSnippetSuggestionMeta, metadata?: CaseMetadata): Promise<void | import("../events").ClickEventResponse>;
|
|
71
|
+
logOpenSmartSnippetInlineLink(info: PartialDocumentInformation, identifierAndLink: DocumentIdentifier & SmartSnippetLinkMeta, metadata?: CaseMetadata): Promise<void | import("../events").ClickEventResponse>;
|
|
72
|
+
logOpenSmartSnippetSuggestionInlineLink(info: PartialDocumentInformation, snippetAndLink: SmartSnippetSuggestionMeta & SmartSnippetLinkMeta, metadata?: CaseMetadata): Promise<void | import("../events").ClickEventResponse>;
|
|
60
73
|
logCustomEvent(event: SearchPageEvents | InsightEvents, metadata?: Record<string, any>): Promise<void | import("../events").CustomEventResponse>;
|
|
61
74
|
logSearchEvent(event: SearchPageEvents | InsightEvents, metadata?: Record<string, any>): Promise<void | import("../events").SearchEventResponse>;
|
|
62
75
|
logClickEvent(event: SearchPageEvents, info: PartialDocumentInformation, identifier: DocumentIdentifier, metadata?: Record<string, any>): Promise<void | import("../events").ClickEventResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const libVersion = "2.26.
|
|
1
|
+
export declare const libVersion = "2.26.6";
|
package/dist/library.es.js
CHANGED
|
@@ -593,7 +593,7 @@ function sha1(bytes) {
|
|
|
593
593
|
const v5 = v35('v5', 0x50, sha1);
|
|
594
594
|
var uuidv5 = v5;
|
|
595
595
|
|
|
596
|
-
const libVersion = "2.26.
|
|
596
|
+
const libVersion = "2.26.6" ;
|
|
597
597
|
|
|
598
598
|
const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
|
|
599
599
|
|
|
@@ -2914,6 +2914,50 @@ class CoveoInsightClient {
|
|
|
2914
2914
|
logCaseDetach(resultUriHash, metadata) {
|
|
2915
2915
|
return this.logCustomEvent(SearchPageEvents.caseDetach, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), { resultUriHash }) : { resultUriHash });
|
|
2916
2916
|
}
|
|
2917
|
+
logLikeSmartSnippet(metadata) {
|
|
2918
|
+
return this.logCustomEvent(SearchPageEvents.likeSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2919
|
+
}
|
|
2920
|
+
logDislikeSmartSnippet(metadata) {
|
|
2921
|
+
return this.logCustomEvent(SearchPageEvents.dislikeSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2922
|
+
}
|
|
2923
|
+
logExpandSmartSnippet(metadata) {
|
|
2924
|
+
return this.logCustomEvent(SearchPageEvents.expandSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2925
|
+
}
|
|
2926
|
+
logCollapseSmartSnippet(metadata) {
|
|
2927
|
+
return this.logCustomEvent(SearchPageEvents.collapseSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2928
|
+
}
|
|
2929
|
+
logOpenSmartSnippetFeedbackModal(metadata) {
|
|
2930
|
+
return this.logCustomEvent(SearchPageEvents.openSmartSnippetFeedbackModal, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2931
|
+
}
|
|
2932
|
+
logCloseSmartSnippetFeedbackModal(metadata) {
|
|
2933
|
+
return this.logCustomEvent(SearchPageEvents.closeSmartSnippetFeedbackModal, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2934
|
+
}
|
|
2935
|
+
logSmartSnippetFeedbackReason(reason, details, metadata) {
|
|
2936
|
+
return this.logCustomEvent(SearchPageEvents.sendSmartSnippetReason, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), { reason, details }) : { reason, details });
|
|
2937
|
+
}
|
|
2938
|
+
logExpandSmartSnippetSuggestion(snippet, metadata) {
|
|
2939
|
+
const snippetMetadata = 'documentId' in snippet ? snippet : { documentId: snippet };
|
|
2940
|
+
return this.logCustomEvent(SearchPageEvents.expandSmartSnippetSuggestion, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), snippetMetadata) : snippetMetadata);
|
|
2941
|
+
}
|
|
2942
|
+
logCollapseSmartSnippetSuggestion(snippet, metadata) {
|
|
2943
|
+
const snippetMetadata = 'documentId' in snippet ? snippet : { documentId: snippet };
|
|
2944
|
+
return this.logCustomEvent(SearchPageEvents.collapseSmartSnippetSuggestion, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), snippetMetadata) : snippetMetadata);
|
|
2945
|
+
}
|
|
2946
|
+
logOpenSmartSnippetSource(info, identifier, metadata) {
|
|
2947
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetSource, info, identifier, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2948
|
+
}
|
|
2949
|
+
logOpenSmartSnippetSuggestionSource(info, snippet, metadata) {
|
|
2950
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetSuggestionSource, info, { contentIDKey: snippet.documentId.contentIdKey, contentIDValue: snippet.documentId.contentIdValue }, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), snippet) : snippet);
|
|
2951
|
+
}
|
|
2952
|
+
logOpenSmartSnippetInlineLink(info, identifierAndLink, metadata) {
|
|
2953
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetInlineLink, info, { contentIDKey: identifierAndLink.contentIDKey, contentIDValue: identifierAndLink.contentIDValue }, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), identifierAndLink) : identifierAndLink);
|
|
2954
|
+
}
|
|
2955
|
+
logOpenSmartSnippetSuggestionInlineLink(info, snippetAndLink, metadata) {
|
|
2956
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetSuggestionInlineLink, info, {
|
|
2957
|
+
contentIDKey: snippetAndLink.documentId.contentIdKey,
|
|
2958
|
+
contentIDValue: snippetAndLink.documentId.contentIdValue,
|
|
2959
|
+
}, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), snippetAndLink) : snippetAndLink);
|
|
2960
|
+
}
|
|
2917
2961
|
logCustomEvent(event, metadata) {
|
|
2918
2962
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2919
2963
|
const customData = Object.assign(Object.assign({}, this.provider.getBaseMetadata()), metadata);
|
package/dist/library.js
CHANGED
|
@@ -740,7 +740,7 @@ function sha1(bytes) {
|
|
|
740
740
|
const v5 = v35('v5', 0x50, sha1);
|
|
741
741
|
var uuidv5 = v5;
|
|
742
742
|
|
|
743
|
-
var libVersion = "2.26.
|
|
743
|
+
var libVersion = "2.26.6" ;
|
|
744
744
|
|
|
745
745
|
var getFormattedLocation = function (location) {
|
|
746
746
|
return location.protocol + "//" + location.hostname + (location.pathname.indexOf('/') === 0 ? location.pathname : "/" + location.pathname) + location.search;
|
|
@@ -85817,6 +85817,50 @@ var CoveoInsightClient = (function () {
|
|
|
85817
85817
|
CoveoInsightClient.prototype.logCaseDetach = function (resultUriHash, metadata) {
|
|
85818
85818
|
return this.logCustomEvent(SearchPageEvents.caseDetach, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), { resultUriHash: resultUriHash }) : { resultUriHash: resultUriHash });
|
|
85819
85819
|
};
|
|
85820
|
+
CoveoInsightClient.prototype.logLikeSmartSnippet = function (metadata) {
|
|
85821
|
+
return this.logCustomEvent(SearchPageEvents.likeSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
85822
|
+
};
|
|
85823
|
+
CoveoInsightClient.prototype.logDislikeSmartSnippet = function (metadata) {
|
|
85824
|
+
return this.logCustomEvent(SearchPageEvents.dislikeSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
85825
|
+
};
|
|
85826
|
+
CoveoInsightClient.prototype.logExpandSmartSnippet = function (metadata) {
|
|
85827
|
+
return this.logCustomEvent(SearchPageEvents.expandSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
85828
|
+
};
|
|
85829
|
+
CoveoInsightClient.prototype.logCollapseSmartSnippet = function (metadata) {
|
|
85830
|
+
return this.logCustomEvent(SearchPageEvents.collapseSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
85831
|
+
};
|
|
85832
|
+
CoveoInsightClient.prototype.logOpenSmartSnippetFeedbackModal = function (metadata) {
|
|
85833
|
+
return this.logCustomEvent(SearchPageEvents.openSmartSnippetFeedbackModal, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
85834
|
+
};
|
|
85835
|
+
CoveoInsightClient.prototype.logCloseSmartSnippetFeedbackModal = function (metadata) {
|
|
85836
|
+
return this.logCustomEvent(SearchPageEvents.closeSmartSnippetFeedbackModal, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
85837
|
+
};
|
|
85838
|
+
CoveoInsightClient.prototype.logSmartSnippetFeedbackReason = function (reason, details, metadata) {
|
|
85839
|
+
return this.logCustomEvent(SearchPageEvents.sendSmartSnippetReason, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), { reason: reason, details: details }) : { reason: reason, details: details });
|
|
85840
|
+
};
|
|
85841
|
+
CoveoInsightClient.prototype.logExpandSmartSnippetSuggestion = function (snippet, metadata) {
|
|
85842
|
+
var snippetMetadata = 'documentId' in snippet ? snippet : { documentId: snippet };
|
|
85843
|
+
return this.logCustomEvent(SearchPageEvents.expandSmartSnippetSuggestion, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), snippetMetadata) : snippetMetadata);
|
|
85844
|
+
};
|
|
85845
|
+
CoveoInsightClient.prototype.logCollapseSmartSnippetSuggestion = function (snippet, metadata) {
|
|
85846
|
+
var snippetMetadata = 'documentId' in snippet ? snippet : { documentId: snippet };
|
|
85847
|
+
return this.logCustomEvent(SearchPageEvents.collapseSmartSnippetSuggestion, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), snippetMetadata) : snippetMetadata);
|
|
85848
|
+
};
|
|
85849
|
+
CoveoInsightClient.prototype.logOpenSmartSnippetSource = function (info, identifier, metadata) {
|
|
85850
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetSource, info, identifier, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
85851
|
+
};
|
|
85852
|
+
CoveoInsightClient.prototype.logOpenSmartSnippetSuggestionSource = function (info, snippet, metadata) {
|
|
85853
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetSuggestionSource, info, { contentIDKey: snippet.documentId.contentIdKey, contentIDValue: snippet.documentId.contentIdValue }, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), snippet) : snippet);
|
|
85854
|
+
};
|
|
85855
|
+
CoveoInsightClient.prototype.logOpenSmartSnippetInlineLink = function (info, identifierAndLink, metadata) {
|
|
85856
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetInlineLink, info, { contentIDKey: identifierAndLink.contentIDKey, contentIDValue: identifierAndLink.contentIDValue }, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), identifierAndLink) : identifierAndLink);
|
|
85857
|
+
};
|
|
85858
|
+
CoveoInsightClient.prototype.logOpenSmartSnippetSuggestionInlineLink = function (info, snippetAndLink, metadata) {
|
|
85859
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetSuggestionInlineLink, info, {
|
|
85860
|
+
contentIDKey: snippetAndLink.documentId.contentIdKey,
|
|
85861
|
+
contentIDValue: snippetAndLink.documentId.contentIdValue,
|
|
85862
|
+
}, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), snippetAndLink) : snippetAndLink);
|
|
85863
|
+
};
|
|
85820
85864
|
CoveoInsightClient.prototype.logCustomEvent = function (event, metadata) {
|
|
85821
85865
|
return __awaiter(this, void 0, void 0, function () {
|
|
85822
85866
|
var customData, payload, _a;
|
package/dist/react-native.es.js
CHANGED
|
@@ -655,7 +655,7 @@ const addPageViewToHistory = (pageViewValue) => __awaiter(void 0, void 0, void 0
|
|
|
655
655
|
yield store.addElementAsync(historyElement);
|
|
656
656
|
});
|
|
657
657
|
|
|
658
|
-
const libVersion = "2.26.
|
|
658
|
+
const libVersion = "2.26.6" ;
|
|
659
659
|
|
|
660
660
|
const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
|
|
661
661
|
|
|
@@ -2932,6 +2932,50 @@ class CoveoInsightClient {
|
|
|
2932
2932
|
logCaseDetach(resultUriHash, metadata) {
|
|
2933
2933
|
return this.logCustomEvent(SearchPageEvents.caseDetach, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), { resultUriHash }) : { resultUriHash });
|
|
2934
2934
|
}
|
|
2935
|
+
logLikeSmartSnippet(metadata) {
|
|
2936
|
+
return this.logCustomEvent(SearchPageEvents.likeSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2937
|
+
}
|
|
2938
|
+
logDislikeSmartSnippet(metadata) {
|
|
2939
|
+
return this.logCustomEvent(SearchPageEvents.dislikeSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2940
|
+
}
|
|
2941
|
+
logExpandSmartSnippet(metadata) {
|
|
2942
|
+
return this.logCustomEvent(SearchPageEvents.expandSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2943
|
+
}
|
|
2944
|
+
logCollapseSmartSnippet(metadata) {
|
|
2945
|
+
return this.logCustomEvent(SearchPageEvents.collapseSmartSnippet, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2946
|
+
}
|
|
2947
|
+
logOpenSmartSnippetFeedbackModal(metadata) {
|
|
2948
|
+
return this.logCustomEvent(SearchPageEvents.openSmartSnippetFeedbackModal, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2949
|
+
}
|
|
2950
|
+
logCloseSmartSnippetFeedbackModal(metadata) {
|
|
2951
|
+
return this.logCustomEvent(SearchPageEvents.closeSmartSnippetFeedbackModal, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2952
|
+
}
|
|
2953
|
+
logSmartSnippetFeedbackReason(reason, details, metadata) {
|
|
2954
|
+
return this.logCustomEvent(SearchPageEvents.sendSmartSnippetReason, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), { reason, details }) : { reason, details });
|
|
2955
|
+
}
|
|
2956
|
+
logExpandSmartSnippetSuggestion(snippet, metadata) {
|
|
2957
|
+
const snippetMetadata = 'documentId' in snippet ? snippet : { documentId: snippet };
|
|
2958
|
+
return this.logCustomEvent(SearchPageEvents.expandSmartSnippetSuggestion, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), snippetMetadata) : snippetMetadata);
|
|
2959
|
+
}
|
|
2960
|
+
logCollapseSmartSnippetSuggestion(snippet, metadata) {
|
|
2961
|
+
const snippetMetadata = 'documentId' in snippet ? snippet : { documentId: snippet };
|
|
2962
|
+
return this.logCustomEvent(SearchPageEvents.collapseSmartSnippetSuggestion, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), snippetMetadata) : snippetMetadata);
|
|
2963
|
+
}
|
|
2964
|
+
logOpenSmartSnippetSource(info, identifier, metadata) {
|
|
2965
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetSource, info, identifier, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
2966
|
+
}
|
|
2967
|
+
logOpenSmartSnippetSuggestionSource(info, snippet, metadata) {
|
|
2968
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetSuggestionSource, info, { contentIDKey: snippet.documentId.contentIdKey, contentIDValue: snippet.documentId.contentIdValue }, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), snippet) : snippet);
|
|
2969
|
+
}
|
|
2970
|
+
logOpenSmartSnippetInlineLink(info, identifierAndLink, metadata) {
|
|
2971
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetInlineLink, info, { contentIDKey: identifierAndLink.contentIDKey, contentIDValue: identifierAndLink.contentIDValue }, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), identifierAndLink) : identifierAndLink);
|
|
2972
|
+
}
|
|
2973
|
+
logOpenSmartSnippetSuggestionInlineLink(info, snippetAndLink, metadata) {
|
|
2974
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetSuggestionInlineLink, info, {
|
|
2975
|
+
contentIDKey: snippetAndLink.documentId.contentIdKey,
|
|
2976
|
+
contentIDValue: snippetAndLink.documentId.contentIdValue,
|
|
2977
|
+
}, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), snippetAndLink) : snippetAndLink);
|
|
2978
|
+
}
|
|
2935
2979
|
logCustomEvent(event, metadata) {
|
|
2936
2980
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2937
2981
|
const customData = Object.assign(Object.assign({}, this.provider.getBaseMetadata()), metadata);
|
package/package.json
CHANGED
|
@@ -352,6 +352,132 @@ describe('InsightClient', () => {
|
|
|
352
352
|
await client.logCaseDetach(fakeDocInfo.documentUriHash);
|
|
353
353
|
expectMatchCustomEventPayload(SearchPageEvents.caseDetach, expectedMetadata);
|
|
354
354
|
});
|
|
355
|
+
|
|
356
|
+
it('should send proper payload for #likeSmartSnippet', async () => {
|
|
357
|
+
await client.logLikeSmartSnippet();
|
|
358
|
+
expectMatchCustomEventPayload(SearchPageEvents.likeSmartSnippet);
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
it('should send proper payload for #dislikeSmartSnippet', async () => {
|
|
362
|
+
await client.logDislikeSmartSnippet();
|
|
363
|
+
expectMatchCustomEventPayload(SearchPageEvents.dislikeSmartSnippet);
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
it('should send proper payload for #expandSmartSnippet', async () => {
|
|
367
|
+
await client.logExpandSmartSnippet();
|
|
368
|
+
expectMatchCustomEventPayload(SearchPageEvents.expandSmartSnippet);
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
it('should send proper payload for #collapseSmartSnippet', async () => {
|
|
372
|
+
await client.logCollapseSmartSnippet();
|
|
373
|
+
expectMatchCustomEventPayload(SearchPageEvents.collapseSmartSnippet);
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
it('should send proper payload for #openSmartSnippetFeedbackModal', async () => {
|
|
377
|
+
await client.logOpenSmartSnippetFeedbackModal();
|
|
378
|
+
expectMatchCustomEventPayload(SearchPageEvents.openSmartSnippetFeedbackModal);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
it('should send proper payload for #closeSmartSnippetFeedbackModal', async () => {
|
|
382
|
+
await client.logCloseSmartSnippetFeedbackModal();
|
|
383
|
+
expectMatchCustomEventPayload(SearchPageEvents.closeSmartSnippetFeedbackModal);
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
it('should send proper payload for #sendSmartSnippetReason', async () => {
|
|
387
|
+
const reason = 'other';
|
|
388
|
+
const details = 'example details';
|
|
389
|
+
const expectedMetadata = {
|
|
390
|
+
reason,
|
|
391
|
+
details,
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
await client.logSmartSnippetFeedbackReason(reason, details);
|
|
395
|
+
expectMatchCustomEventPayload(SearchPageEvents.sendSmartSnippetReason, expectedMetadata);
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
it('should send proper payload for #expandSmartSnippetSuggestion', async () => {
|
|
399
|
+
const exampleSmartSnippetSuggestion = {
|
|
400
|
+
question: 'Abc',
|
|
401
|
+
answerSnippet: 'Def',
|
|
402
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
await client.logExpandSmartSnippetSuggestion(exampleSmartSnippetSuggestion);
|
|
406
|
+
expectMatchCustomEventPayload(SearchPageEvents.expandSmartSnippetSuggestion, exampleSmartSnippetSuggestion);
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
it('should send proper payload for #collapseSmartSnippetSuggestion', async () => {
|
|
410
|
+
const exampleSmartSnippetSuggestion = {
|
|
411
|
+
question: 'Abc',
|
|
412
|
+
answerSnippet: 'Def',
|
|
413
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
await client.logCollapseSmartSnippetSuggestion(exampleSmartSnippetSuggestion);
|
|
417
|
+
expectMatchCustomEventPayload(
|
|
418
|
+
SearchPageEvents.collapseSmartSnippetSuggestion,
|
|
419
|
+
exampleSmartSnippetSuggestion
|
|
420
|
+
);
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
it('should send proper payload for #openSmartSnippetSource', async () => {
|
|
424
|
+
await client.logOpenSmartSnippetSource(fakeDocInfo, fakeDocID);
|
|
425
|
+
expectMatchDocumentPayload(SearchPageEvents.openSmartSnippetSource, fakeDocInfo, fakeDocID);
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
it('should send proper payload for #openSmartSnippetInlineLink', async () => {
|
|
429
|
+
const meta = {
|
|
430
|
+
...fakeDocID,
|
|
431
|
+
linkText: 'Some text',
|
|
432
|
+
linkURL: 'https://invalid.com',
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
await client.logOpenSmartSnippetInlineLink(fakeDocInfo, meta);
|
|
436
|
+
expectMatchDocumentPayload(SearchPageEvents.openSmartSnippetInlineLink, fakeDocInfo, meta);
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
it('should send proper payload for #openSmartSnippetSuggestionSource', async () => {
|
|
440
|
+
const meta = {
|
|
441
|
+
question: 'Abc',
|
|
442
|
+
answerSnippet: 'Def',
|
|
443
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
const expectedMetadata = {
|
|
447
|
+
...meta,
|
|
448
|
+
contentIDKey: meta.documentId.contentIdKey,
|
|
449
|
+
contentIDValue: meta.documentId.contentIdValue,
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
await client.logOpenSmartSnippetSuggestionSource(fakeDocInfo, meta);
|
|
453
|
+
expectMatchDocumentPayload(
|
|
454
|
+
SearchPageEvents.openSmartSnippetSuggestionSource,
|
|
455
|
+
fakeDocInfo,
|
|
456
|
+
expectedMetadata
|
|
457
|
+
);
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
it('should send proper payload for #openSmartSnippetSuggestionInlineLink', async () => {
|
|
461
|
+
const meta = {
|
|
462
|
+
question: 'Abc',
|
|
463
|
+
answerSnippet: 'Def',
|
|
464
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
465
|
+
linkText: 'Some text',
|
|
466
|
+
linkURL: 'https://invalid.com',
|
|
467
|
+
};
|
|
468
|
+
const expectedMetadata = {
|
|
469
|
+
...meta,
|
|
470
|
+
contentIDKey: meta.documentId.contentIdKey,
|
|
471
|
+
contentIDValue: meta.documentId.contentIdValue,
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
await client.logOpenSmartSnippetSuggestionInlineLink(fakeDocInfo, meta);
|
|
475
|
+
expectMatchDocumentPayload(
|
|
476
|
+
SearchPageEvents.openSmartSnippetSuggestionInlineLink,
|
|
477
|
+
fakeDocInfo,
|
|
478
|
+
expectedMetadata
|
|
479
|
+
);
|
|
480
|
+
});
|
|
355
481
|
});
|
|
356
482
|
|
|
357
483
|
describe('when the case metadata is included', () => {
|
|
@@ -758,6 +884,148 @@ describe('InsightClient', () => {
|
|
|
758
884
|
await client.logCaseDetach(fakeDocInfo.documentUriHash, metadata);
|
|
759
885
|
expectMatchCustomEventPayload(SearchPageEvents.caseDetach, expectedMetadata);
|
|
760
886
|
});
|
|
887
|
+
|
|
888
|
+
it('should send proper payload for #likeSmartSnippet', async () => {
|
|
889
|
+
await client.logLikeSmartSnippet(baseCaseMetadata);
|
|
890
|
+
expectMatchCustomEventPayload(SearchPageEvents.likeSmartSnippet, expectedBaseCaseMetadata);
|
|
891
|
+
});
|
|
892
|
+
|
|
893
|
+
it('should send proper payload for #dislikeSmartSnippet', async () => {
|
|
894
|
+
await client.logDislikeSmartSnippet(baseCaseMetadata);
|
|
895
|
+
expectMatchCustomEventPayload(SearchPageEvents.dislikeSmartSnippet, expectedBaseCaseMetadata);
|
|
896
|
+
});
|
|
897
|
+
|
|
898
|
+
it('should send proper payload for #expandSmartSnippet', async () => {
|
|
899
|
+
await client.logExpandSmartSnippet(baseCaseMetadata);
|
|
900
|
+
expectMatchCustomEventPayload(SearchPageEvents.expandSmartSnippet, expectedBaseCaseMetadata);
|
|
901
|
+
});
|
|
902
|
+
|
|
903
|
+
it('should send proper payload for #collapseSmartSnippet', async () => {
|
|
904
|
+
await client.logCollapseSmartSnippet(baseCaseMetadata);
|
|
905
|
+
expectMatchCustomEventPayload(SearchPageEvents.collapseSmartSnippet, expectedBaseCaseMetadata);
|
|
906
|
+
});
|
|
907
|
+
|
|
908
|
+
it('should send proper payload for #openSmartSnippetFeedbackModal', async () => {
|
|
909
|
+
await client.logOpenSmartSnippetFeedbackModal(baseCaseMetadata);
|
|
910
|
+
expectMatchCustomEventPayload(SearchPageEvents.openSmartSnippetFeedbackModal, expectedBaseCaseMetadata);
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
it('should send proper payload for #closeSmartSnippetFeedbackModal', async () => {
|
|
914
|
+
await client.logCloseSmartSnippetFeedbackModal(baseCaseMetadata);
|
|
915
|
+
expectMatchCustomEventPayload(SearchPageEvents.closeSmartSnippetFeedbackModal, expectedBaseCaseMetadata);
|
|
916
|
+
});
|
|
917
|
+
|
|
918
|
+
it('should send proper payload for #sendSmartSnippetReason', async () => {
|
|
919
|
+
const reason = 'other';
|
|
920
|
+
const details = 'example details';
|
|
921
|
+
const expectedMetadata = {
|
|
922
|
+
reason,
|
|
923
|
+
details,
|
|
924
|
+
...expectedBaseCaseMetadata,
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
await client.logSmartSnippetFeedbackReason(reason, details, baseCaseMetadata);
|
|
928
|
+
expectMatchCustomEventPayload(SearchPageEvents.sendSmartSnippetReason, expectedMetadata);
|
|
929
|
+
});
|
|
930
|
+
|
|
931
|
+
it('should send proper payload for #expandSmartSnippetSuggestion', async () => {
|
|
932
|
+
const exampleSmartSnippetSuggestion = {
|
|
933
|
+
question: 'Abc',
|
|
934
|
+
answerSnippet: 'Def',
|
|
935
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
936
|
+
};
|
|
937
|
+
const expectedMetadata = {
|
|
938
|
+
...exampleSmartSnippetSuggestion,
|
|
939
|
+
...expectedBaseCaseMetadata,
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
await client.logExpandSmartSnippetSuggestion(exampleSmartSnippetSuggestion, baseCaseMetadata);
|
|
943
|
+
expectMatchCustomEventPayload(SearchPageEvents.expandSmartSnippetSuggestion, expectedMetadata);
|
|
944
|
+
});
|
|
945
|
+
|
|
946
|
+
it('should send proper payload for #collapseSmartSnippetSuggestion', async () => {
|
|
947
|
+
const exampleSmartSnippetSuggestion = {
|
|
948
|
+
question: 'Abc',
|
|
949
|
+
answerSnippet: 'Def',
|
|
950
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
951
|
+
};
|
|
952
|
+
const expectedMetadata = {
|
|
953
|
+
...exampleSmartSnippetSuggestion,
|
|
954
|
+
...expectedBaseCaseMetadata,
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
await client.logCollapseSmartSnippetSuggestion(exampleSmartSnippetSuggestion, baseCaseMetadata);
|
|
958
|
+
expectMatchCustomEventPayload(SearchPageEvents.collapseSmartSnippetSuggestion, expectedMetadata);
|
|
959
|
+
});
|
|
960
|
+
|
|
961
|
+
it('should send proper payload for #openSmartSnippetSource', async () => {
|
|
962
|
+
const expectedMetadata = {
|
|
963
|
+
...fakeDocID,
|
|
964
|
+
...expectedBaseCaseMetadata,
|
|
965
|
+
};
|
|
966
|
+
await client.logOpenSmartSnippetSource(fakeDocInfo, fakeDocID, baseCaseMetadata);
|
|
967
|
+
expectMatchDocumentPayload(SearchPageEvents.openSmartSnippetSource, fakeDocInfo, expectedMetadata);
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
it('should send proper payload for #openSmartSnippetInlineLink', async () => {
|
|
971
|
+
const meta = {
|
|
972
|
+
...fakeDocID,
|
|
973
|
+
linkText: 'Some text',
|
|
974
|
+
linkURL: 'https://invalid.com',
|
|
975
|
+
};
|
|
976
|
+
const expectedMetadata = {
|
|
977
|
+
...meta,
|
|
978
|
+
...expectedBaseCaseMetadata,
|
|
979
|
+
};
|
|
980
|
+
|
|
981
|
+
await client.logOpenSmartSnippetInlineLink(fakeDocInfo, meta, baseCaseMetadata);
|
|
982
|
+
expectMatchDocumentPayload(SearchPageEvents.openSmartSnippetInlineLink, fakeDocInfo, expectedMetadata);
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
it('should send proper payload for #openSmartSnippetSuggestionSource', async () => {
|
|
986
|
+
const meta = {
|
|
987
|
+
question: 'Abc',
|
|
988
|
+
answerSnippet: 'Def',
|
|
989
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
const expectedMetadata = {
|
|
993
|
+
...meta,
|
|
994
|
+
...expectedBaseCaseMetadata,
|
|
995
|
+
contentIDKey: meta.documentId.contentIdKey,
|
|
996
|
+
contentIDValue: meta.documentId.contentIdValue,
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
await client.logOpenSmartSnippetSuggestionSource(fakeDocInfo, meta, baseCaseMetadata);
|
|
1000
|
+
expectMatchDocumentPayload(
|
|
1001
|
+
SearchPageEvents.openSmartSnippetSuggestionSource,
|
|
1002
|
+
fakeDocInfo,
|
|
1003
|
+
expectedMetadata
|
|
1004
|
+
);
|
|
1005
|
+
});
|
|
1006
|
+
|
|
1007
|
+
it('should send proper payload for #openSmartSnippetSuggestionInlineLink', async () => {
|
|
1008
|
+
const meta = {
|
|
1009
|
+
question: 'Abc',
|
|
1010
|
+
answerSnippet: 'Def',
|
|
1011
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
1012
|
+
linkText: 'Some text',
|
|
1013
|
+
linkURL: 'https://invalid.com',
|
|
1014
|
+
};
|
|
1015
|
+
const expectedMetadata = {
|
|
1016
|
+
...meta,
|
|
1017
|
+
...expectedBaseCaseMetadata,
|
|
1018
|
+
contentIDKey: meta.documentId.contentIdKey,
|
|
1019
|
+
contentIDValue: meta.documentId.contentIdValue,
|
|
1020
|
+
};
|
|
1021
|
+
|
|
1022
|
+
await client.logOpenSmartSnippetSuggestionInlineLink(fakeDocInfo, meta, baseCaseMetadata);
|
|
1023
|
+
expectMatchDocumentPayload(
|
|
1024
|
+
SearchPageEvents.openSmartSnippetSuggestionInlineLink,
|
|
1025
|
+
fakeDocInfo,
|
|
1026
|
+
expectedMetadata
|
|
1027
|
+
);
|
|
1028
|
+
});
|
|
761
1029
|
});
|
|
762
1030
|
|
|
763
1031
|
it('should enable analytics tracking by default', () => {
|
|
@@ -8,6 +8,10 @@ import {
|
|
|
8
8
|
FacetStateMetadata,
|
|
9
9
|
PartialDocumentInformation,
|
|
10
10
|
SearchPageEvents,
|
|
11
|
+
SmartSnippetDocumentIdentifier,
|
|
12
|
+
SmartSnippetFeedbackReason,
|
|
13
|
+
SmartSnippetLinkMeta,
|
|
14
|
+
SmartSnippetSuggestionMeta,
|
|
11
15
|
} from '../searchPage/searchPageEvents';
|
|
12
16
|
import {
|
|
13
17
|
ExpandToFullUIMetadata,
|
|
@@ -315,6 +319,136 @@ export class CoveoInsightClient {
|
|
|
315
319
|
);
|
|
316
320
|
}
|
|
317
321
|
|
|
322
|
+
public logLikeSmartSnippet(metadata?: CaseMetadata) {
|
|
323
|
+
return this.logCustomEvent(
|
|
324
|
+
SearchPageEvents.likeSmartSnippet,
|
|
325
|
+
metadata ? generateMetadataToSend(metadata, false) : undefined
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
public logDislikeSmartSnippet(metadata?: CaseMetadata) {
|
|
330
|
+
return this.logCustomEvent(
|
|
331
|
+
SearchPageEvents.dislikeSmartSnippet,
|
|
332
|
+
metadata ? generateMetadataToSend(metadata, false) : undefined
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
public logExpandSmartSnippet(metadata?: CaseMetadata) {
|
|
337
|
+
return this.logCustomEvent(
|
|
338
|
+
SearchPageEvents.expandSmartSnippet,
|
|
339
|
+
metadata ? generateMetadataToSend(metadata, false) : undefined
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
public logCollapseSmartSnippet(metadata?: CaseMetadata) {
|
|
344
|
+
return this.logCustomEvent(
|
|
345
|
+
SearchPageEvents.collapseSmartSnippet,
|
|
346
|
+
metadata ? generateMetadataToSend(metadata, false) : undefined
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
public logOpenSmartSnippetFeedbackModal(metadata?: CaseMetadata) {
|
|
351
|
+
return this.logCustomEvent(
|
|
352
|
+
SearchPageEvents.openSmartSnippetFeedbackModal,
|
|
353
|
+
metadata ? generateMetadataToSend(metadata, false) : undefined
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
public logCloseSmartSnippetFeedbackModal(metadata?: CaseMetadata) {
|
|
358
|
+
return this.logCustomEvent(
|
|
359
|
+
SearchPageEvents.closeSmartSnippetFeedbackModal,
|
|
360
|
+
metadata ? generateMetadataToSend(metadata, false) : undefined
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
public logSmartSnippetFeedbackReason(
|
|
365
|
+
reason: SmartSnippetFeedbackReason,
|
|
366
|
+
details?: string,
|
|
367
|
+
metadata?: CaseMetadata
|
|
368
|
+
) {
|
|
369
|
+
return this.logCustomEvent(
|
|
370
|
+
SearchPageEvents.sendSmartSnippetReason,
|
|
371
|
+
metadata ? {...generateMetadataToSend(metadata, false), reason, details} : {reason, details}
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
public logExpandSmartSnippetSuggestion(
|
|
376
|
+
snippet: SmartSnippetSuggestionMeta | SmartSnippetDocumentIdentifier,
|
|
377
|
+
metadata?: CaseMetadata
|
|
378
|
+
) {
|
|
379
|
+
const snippetMetadata = 'documentId' in snippet ? snippet : {documentId: snippet};
|
|
380
|
+
return this.logCustomEvent(
|
|
381
|
+
SearchPageEvents.expandSmartSnippetSuggestion,
|
|
382
|
+
metadata ? {...generateMetadataToSend(metadata, false), ...snippetMetadata} : snippetMetadata
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
public logCollapseSmartSnippetSuggestion(
|
|
387
|
+
snippet: SmartSnippetSuggestionMeta | SmartSnippetDocumentIdentifier,
|
|
388
|
+
metadata?: CaseMetadata
|
|
389
|
+
) {
|
|
390
|
+
const snippetMetadata = 'documentId' in snippet ? snippet : {documentId: snippet};
|
|
391
|
+
return this.logCustomEvent(
|
|
392
|
+
SearchPageEvents.collapseSmartSnippetSuggestion,
|
|
393
|
+
metadata ? {...generateMetadataToSend(metadata, false), ...snippetMetadata} : snippetMetadata
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
public logOpenSmartSnippetSource(
|
|
398
|
+
info: PartialDocumentInformation,
|
|
399
|
+
identifier: DocumentIdentifier,
|
|
400
|
+
metadata?: CaseMetadata
|
|
401
|
+
) {
|
|
402
|
+
return this.logClickEvent(
|
|
403
|
+
SearchPageEvents.openSmartSnippetSource,
|
|
404
|
+
info,
|
|
405
|
+
identifier,
|
|
406
|
+
metadata ? generateMetadataToSend(metadata, false) : undefined
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
public logOpenSmartSnippetSuggestionSource(
|
|
411
|
+
info: PartialDocumentInformation,
|
|
412
|
+
snippet: SmartSnippetSuggestionMeta,
|
|
413
|
+
metadata?: CaseMetadata
|
|
414
|
+
) {
|
|
415
|
+
return this.logClickEvent(
|
|
416
|
+
SearchPageEvents.openSmartSnippetSuggestionSource,
|
|
417
|
+
info,
|
|
418
|
+
{contentIDKey: snippet.documentId.contentIdKey, contentIDValue: snippet.documentId.contentIdValue},
|
|
419
|
+
metadata ? {...generateMetadataToSend(metadata, false), ...snippet} : snippet
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
public logOpenSmartSnippetInlineLink(
|
|
424
|
+
info: PartialDocumentInformation,
|
|
425
|
+
identifierAndLink: DocumentIdentifier & SmartSnippetLinkMeta,
|
|
426
|
+
metadata?: CaseMetadata
|
|
427
|
+
) {
|
|
428
|
+
return this.logClickEvent(
|
|
429
|
+
SearchPageEvents.openSmartSnippetInlineLink,
|
|
430
|
+
info,
|
|
431
|
+
{contentIDKey: identifierAndLink.contentIDKey, contentIDValue: identifierAndLink.contentIDValue},
|
|
432
|
+
metadata ? {...generateMetadataToSend(metadata, false), ...identifierAndLink} : identifierAndLink
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
public logOpenSmartSnippetSuggestionInlineLink(
|
|
437
|
+
info: PartialDocumentInformation,
|
|
438
|
+
snippetAndLink: SmartSnippetSuggestionMeta & SmartSnippetLinkMeta,
|
|
439
|
+
metadata?: CaseMetadata
|
|
440
|
+
) {
|
|
441
|
+
return this.logClickEvent(
|
|
442
|
+
SearchPageEvents.openSmartSnippetSuggestionInlineLink,
|
|
443
|
+
info,
|
|
444
|
+
{
|
|
445
|
+
contentIDKey: snippetAndLink.documentId.contentIdKey,
|
|
446
|
+
contentIDValue: snippetAndLink.documentId.contentIdValue,
|
|
447
|
+
},
|
|
448
|
+
metadata ? {...generateMetadataToSend(metadata, false), ...snippetAndLink} : snippetAndLink
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
|
|
318
452
|
public async logCustomEvent(event: SearchPageEvents | InsightEvents, metadata?: Record<string, any>) {
|
|
319
453
|
const customData = {...this.provider.getBaseMetadata(), ...metadata};
|
|
320
454
|
|