coveo.analytics 2.20.4 → 2.20.5
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.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/insight/insightClient.d.ts +2 -1
- package/dist/library.es.js +3 -0
- package/dist/library.js +3 -0
- package/package.json +1 -1
- package/src/insight/insightClient.spec.ts +7 -0
- package/src/insight/insightClient.ts +5 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnalyticsClient, ClientOptions } from '../client/analytics';
|
|
2
2
|
import { SearchEventRequest } from '../events';
|
|
3
|
-
import { FacetBaseMeta, FacetMetadata, FacetSortMeta, FacetStateMetadata, QueryErrorMeta, SearchPageEvents } from '../searchPage/searchPageEvents';
|
|
3
|
+
import { FacetBaseMeta, FacetMetadata, FacetSortMeta, FacetStateMetadata, InterfaceChangeMetadata, QueryErrorMeta, SearchPageEvents } from '../searchPage/searchPageEvents';
|
|
4
4
|
export interface InsightClientProvider {
|
|
5
5
|
getSearchEventRequestPayload: () => Omit<SearchEventRequest, 'actionCause' | 'searchQueryUid'>;
|
|
6
6
|
getSearchUID: () => string;
|
|
@@ -25,6 +25,7 @@ export declare class CoveoInsightClient {
|
|
|
25
25
|
disable(): void;
|
|
26
26
|
enable(): void;
|
|
27
27
|
logInterfaceLoad(): Promise<void | import("../events").SearchEventResponse>;
|
|
28
|
+
logInterfaceChange(metadata: InterfaceChangeMetadata): Promise<void | import("../events").SearchEventResponse>;
|
|
28
29
|
logFetchMoreResults(): Promise<void | import("../events").CustomEventResponse>;
|
|
29
30
|
logFacetSelect(meta: FacetMetadata): Promise<void | import("../events").SearchEventResponse>;
|
|
30
31
|
logFacetDeselect(meta: FacetMetadata): Promise<void | import("../events").SearchEventResponse>;
|
package/dist/library.es.js
CHANGED
|
@@ -1784,6 +1784,9 @@ class CoveoInsightClient {
|
|
|
1784
1784
|
logInterfaceLoad() {
|
|
1785
1785
|
return this.logSearchEvent(SearchPageEvents.interfaceLoad);
|
|
1786
1786
|
}
|
|
1787
|
+
logInterfaceChange(metadata) {
|
|
1788
|
+
return this.logSearchEvent(SearchPageEvents.interfaceChange, metadata);
|
|
1789
|
+
}
|
|
1787
1790
|
logFetchMoreResults() {
|
|
1788
1791
|
return this.logCustomEvent(SearchPageEvents.pagerScrolling, { type: 'getMoreResults' });
|
|
1789
1792
|
}
|
package/dist/library.js
CHANGED
|
@@ -84165,6 +84165,9 @@ var CoveoInsightClient = (function () {
|
|
|
84165
84165
|
CoveoInsightClient.prototype.logInterfaceLoad = function () {
|
|
84166
84166
|
return this.logSearchEvent(SearchPageEvents.interfaceLoad);
|
|
84167
84167
|
};
|
|
84168
|
+
CoveoInsightClient.prototype.logInterfaceChange = function (metadata) {
|
|
84169
|
+
return this.logSearchEvent(SearchPageEvents.interfaceChange, metadata);
|
|
84170
|
+
};
|
|
84168
84171
|
CoveoInsightClient.prototype.logFetchMoreResults = function () {
|
|
84169
84172
|
return this.logCustomEvent(SearchPageEvents.pagerScrolling, { type: 'getMoreResults' });
|
|
84170
84173
|
};
|
package/package.json
CHANGED
|
@@ -107,6 +107,13 @@ describe('InsightClient', () => {
|
|
|
107
107
|
expectMatchPayload(SearchPageEvents.interfaceLoad);
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
+
it('should send proper payload for #interfaceChange', async () => {
|
|
111
|
+
await client.logInterfaceChange({
|
|
112
|
+
interfaceChangeTo: 'bob',
|
|
113
|
+
});
|
|
114
|
+
expectMatchPayload(SearchPageEvents.interfaceChange, {interfaceChangeTo: 'bob'});
|
|
115
|
+
});
|
|
116
|
+
|
|
110
117
|
it('should send proper payload for #fetchMoreResults', async () => {
|
|
111
118
|
await client.logFetchMoreResults();
|
|
112
119
|
expectMatchCustomEventPayload(SearchPageEvents.pagerScrolling, {type: 'getMoreResults'});
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
FacetMetadata,
|
|
9
9
|
FacetSortMeta,
|
|
10
10
|
FacetStateMetadata,
|
|
11
|
+
InterfaceChangeMetadata,
|
|
11
12
|
QueryErrorMeta,
|
|
12
13
|
SearchPageEvents,
|
|
13
14
|
} from '../searchPage/searchPageEvents';
|
|
@@ -53,6 +54,10 @@ export class CoveoInsightClient {
|
|
|
53
54
|
return this.logSearchEvent(SearchPageEvents.interfaceLoad);
|
|
54
55
|
}
|
|
55
56
|
|
|
57
|
+
public logInterfaceChange(metadata: InterfaceChangeMetadata) {
|
|
58
|
+
return this.logSearchEvent(SearchPageEvents.interfaceChange, metadata);
|
|
59
|
+
}
|
|
60
|
+
|
|
56
61
|
public logFetchMoreResults() {
|
|
57
62
|
return this.logCustomEvent(SearchPageEvents.pagerScrolling, {type: 'getMoreResults'});
|
|
58
63
|
}
|