coveo.analytics 2.30.45 → 2.30.46
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/README.md +41 -41
- package/dist/browser.mjs +34 -16
- package/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.debug.js +54 -36
- 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 +2 -2
- package/dist/definitions/insight/insightClient.d.ts +2 -0
- package/dist/definitions/version.d.ts +1 -1
- package/dist/library.cjs +151 -43
- package/dist/library.es.js +34 -16
- package/dist/library.js +151 -43
- package/dist/library.mjs +151 -43
- package/dist/react-native.es.js +34 -16
- package/package.json +7 -7
- package/src/caseAssist/caseAssistClient.spec.ts +5 -5
- package/src/caseAssist/caseAssistClient.ts +7 -4
- package/src/client/analytics.spec.ts +1 -1
- package/src/client/analytics.ts +11 -11
- package/src/client/analyticsBeaconClient.spec.ts +10 -10
- package/src/client/analyticsBeaconClient.ts +4 -4
- package/src/client/analyticsFetchClient.ts +1 -1
- package/src/client/analyticsRequestClient.ts +1 -1
- package/src/client/measurementProtocolMapper.ts +2 -2
- package/src/client/measurementProtocolMapping/baseMeasurementProtocolMapper.ts +1 -1
- package/src/client/measurementProtocolMapping/commerceMeasurementProtocolMapper.ts +5 -5
- package/src/client/noopAnalytics.ts +1 -1
- package/src/client/utils.spec.ts +6 -6
- package/src/coveoua/browser.ts +2 -2
- package/src/coveoua/plugins.ts +1 -1
- package/src/coveoua/simpleanalytics.spec.ts +5 -5
- package/src/coveoua/simpleanalytics.ts +1 -1
- package/src/donottrack.spec.ts +1 -1
- package/src/history.spec.ts +1 -1
- package/src/insight/insightClient.spec.ts +42 -8
- package/src/insight/insightClient.ts +82 -63
- package/src/plugins/ec.spec.ts +6 -6
- package/src/plugins/ec.ts +5 -5
- package/src/plugins/link.spec.ts +5 -5
- package/src/plugins/link.ts +1 -1
- package/src/plugins/svc.ts +1 -1
- package/src/searchPage/searchPageClient.spec.ts +3 -3
- package/src/searchPage/searchPageClient.ts +27 -24
- package/src/searchPage/searchPageEvents.ts +2 -1
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -43,37 +43,37 @@ After the library has loaded sucessfully, you can interact with coveoua through
|
|
|
43
43
|
|
|
44
44
|
### Initialization
|
|
45
45
|
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
46
|
+
- `coveoua('version')`: Returns the current version of the tracking library.
|
|
47
|
+
- `coveoua('init', <COVEO_API_KEY>, <ENDPOINT>)`: Initializes the library with the given api key and endpoint. The following parameters are accepted
|
|
48
|
+
- COVEO_API_KEY (mandatory): A valid api key.
|
|
49
|
+
- ENDPOINT (optional): A string specifying the desired analytics endpoint. The default value is https://analytics.cloud.coveo.com/rest/ua. In case your organization is HIPAA enabled, you should override with https://analyticshipaa.cloud.coveo.com/rest/ua.
|
|
50
|
+
- `coveoua('init', <COVEO_API_KEY>, {endpoint: <ENDPOINT>, isCustomEndpoint: <IS_CUSTOM_ENDPOINT>, plugins: <PLUGINS>})`: Initializes the library with the given api key, endpoint, isCustomEndpoint option and plugins. The following parameters are accepted
|
|
51
|
+
- COVEO_API_KEY (mandatory): A valid api key.
|
|
52
|
+
- ENDPOINT (optional): An object string specifying the desired analytics endpoint. The default value is https://analytics.cloud.coveo.com/rest/ua. In case your organization is HIPAA enabled, you should override with https://analyticshipaa.cloud.coveo.com/rest/ua.
|
|
53
|
+
- IS_CUSTOM_ENDPOINT (optional): An boolean specifying if the desired analytics endpoint is custom. This means the library will not try to add any prefix logic like /rest/ua at the end of the provided endpoint. This can be useful when implementing analytics through a reverse-proxy solution like cloudfront.
|
|
54
|
+
- PLUGINS (optional): An array of known plugin names. See [plugins](#plugins) for more information.
|
|
55
|
+
- `coveoua('set', <NAME>, <VALUE>)`: Attempts to inject an attribute with given name and value on every logged event, overriding any existing value. Some payloads may reject attributes they do not support.
|
|
56
|
+
- `coveoua('set', <OBJECT>)`: Attempts to inject all attributes and values of the given object on every logged event, overriding any existing value. Some payloads may reject attributes they do not support.
|
|
57
|
+
- `coveoua('set', 'custom', <OBJECT>)`: Attempts to inject all attributes and values of the given object in the custom section of an object, overriding any existing value. Use this call to pass customer specific parameters on the payload.
|
|
58
|
+
- `coveoua('onLoad', <CALLBACK>)`: Calls the specified function immediately, library initialization is not required.
|
|
59
|
+
- `coveoua('reset')`: Resets the state of the logger to the state before initialization.
|
|
60
60
|
|
|
61
61
|
### Sending events
|
|
62
62
|
|
|
63
|
-
-
|
|
63
|
+
- `coveoua('send', <EVENT_NAME>, <EVENT_PAYLOAD>)`: Sends an event with a given name and payload to the analytics endpoint.
|
|
64
64
|
|
|
65
65
|
### Plugin control
|
|
66
66
|
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
67
|
+
- `coveoua('provide', <PLUGIN_NAME>, <PLUGINCLASS>)`: Registers a given pluginClass with the analytics library under the provided name.
|
|
68
|
+
- `coveoua('require', <PLUGIN_NAME>)`: Explicitly loads the plugin with the given name.
|
|
69
|
+
- `coveoua('callPlugin', <PLUGIN_NAME>, <FUNCTION>, <PARAMS>)`: Executes the specified function with given arguments on the given plugin name. Can be shorthanded using a plugin action prefix `coveoua(<PLUGINNAME>:<FUNCTION>, <PARAMS>)`.
|
|
70
70
|
|
|
71
71
|
## Plugins
|
|
72
72
|
|
|
73
73
|
Coveoua is set up in a modular way with different plugins providing functionality that may be specific to a given usecase. This allows you to customize some of its behavior dynamically. By default, the following plugins are loaded at library initialization:
|
|
74
74
|
|
|
75
|
-
-
|
|
76
|
-
-
|
|
75
|
+
- `ec`: eCommerce plugin which takes care of sending eCommerce specific events.
|
|
76
|
+
- `svc`: Service plugin which takes care of sending customer service specific events.
|
|
77
77
|
|
|
78
78
|
Plugin actions extend the set of available actions. They can be executed either via the `callPlugin` action above, or via the shorthand. For example, to call the function `addImpression` on the `ec` plugin, you'd specify `coveoua('ec:addImpression', ...)`.
|
|
79
79
|
|
|
@@ -85,11 +85,11 @@ In most common integration usecases, you will be using Coveo pre-wired component
|
|
|
85
85
|
|
|
86
86
|
When you are not using any specific Coveo web component, you need to send these events payloads explicitly, use the `send` action to transmit an assembled payload to the usage analytics backend. See the [Usage Analytics Events](https://docs.coveo.com/en/2949/analyze-usage-data/usage-analytics-events) documentation for description of the payload contents. The following event types are supported in coveoua:
|
|
87
87
|
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
88
|
+
- `search`: sends a [client side search](https://docs.coveo.com/en/1502/build-a-search-ui/log-search-events) event.
|
|
89
|
+
- `click`: sends a [click event](https://docs.coveo.com/en/2064/build-a-search-ui/log-click-events).
|
|
90
|
+
- `view`: sends a [view event](https://docs.coveo.com/en/2651/build-a-search-ui/log-view-events).
|
|
91
|
+
- `custom`: sends a [custom event](https://docs.coveo.com/en/2650/build-a-search-ui/log-custom-events).
|
|
92
|
+
- `collect`: sends a [collect event](https://docs.coveo.com/en/l41i0031/build-a-search-ui/log-collect-events) payload. We strongly recommend you use the simplified api in the ecommerce plugin [to send these events instead](#sending-commerce-specific-events).
|
|
93
93
|
|
|
94
94
|
For example, in order to send a click event after a user has interacted with a Coveo provided result, first initialize the library with an api key and then send a click event with the appropriate payload. Refer to the [click event documentation](https://docs.coveo.com/en/2064/build-a-search-ui/log-click-events) for up to date information on event payloads.
|
|
95
95
|
|
|
@@ -103,14 +103,14 @@ You should be able to observe the click event being transmitted to the Coveo bac
|
|
|
103
103
|
|
|
104
104
|
Commerce specific events such as product selections, shopping cart modifications and transactions are sent to Coveo in the compact [collect protocol](https://docs.coveo.com/en/l41i0031/build-a-search-ui/log-collect-events). Rather than explicitly assembling these payloads by hand, the eCommerce plugin provides APIs to assemble and transmit the payloads. The `event` is specific to the eCommerce plugin:
|
|
105
105
|
|
|
106
|
-
-
|
|
106
|
+
- `event`: An event, which has been assembled through different plugin actions.
|
|
107
107
|
|
|
108
108
|
The eCommerce plugin supports adding product data (`ec:addProduct`) as well as setting the [appropriate event action](https://docs.coveo.com/en/l29e0540/coveo-for-commerce/commerce-events-reference#product-action-type-reference) through `ec:setAction`. These calls can be used in series to assemble different types of payloads:
|
|
109
109
|
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
110
|
+
- A [product detail view](https://docs.coveo.com/en/l2pd0522)
|
|
111
|
+
- [Cart modification events](https://docs.coveo.com/en/n39h1594/)
|
|
112
|
+
- A [cart purchase](https://docs.coveo.com/en/l39m0327/coveo-for-commerce/measure-a-purchase)
|
|
113
|
+
- An [event on a search-driven listing-page](https://docs.coveo.com/en/l41a1037/coveo-for-commerce/measure-events-on-a-listing-or-search-page)
|
|
114
114
|
|
|
115
115
|
As a sample, here is how a [cart modification event](https://docs.coveo.com/en/l3jg0266/coveo-for-commerce/measure-cart-page-events#measure-an-increase-in-item-quantity-in-cart) is assembled:
|
|
116
116
|
|
|
@@ -131,11 +131,11 @@ As a sample, here is how a [cart modification event](https://docs.coveo.com/en/l
|
|
|
131
131
|
|
|
132
132
|
To help track a visitor across different domains, the library offers functionality to initialize a clientId from a URL query parameter. The query parameter is named `cvo_cid` with value `<clientid>.<timestamp>`. The clientId is encoded without dashes and the timestamp is encoded in seconds since epoch, both to save space in the url. Both are separated by a period. A sample parameter could be `cvo_cid=c0b48880743e484f8044d7c37910c55b.1676298678`. This query parameter will be picked up by the target page if the following conditions hold:
|
|
133
133
|
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
134
|
+
- The target page has a equal or greater version of coveo.analytics.js loaded.
|
|
135
|
+
- The current URL contains a `cvo_cid` query parameter
|
|
136
|
+
- The parameter contains a valid uuid.
|
|
137
|
+
- The parameter contains a valid timestamp, and that timestamp is no more than 120 seconds in the past.
|
|
138
|
+
- The receiving page has specified a list of valid referrers and the current referrer host matches that list, using wildcards, including ports, specified using `coveoua('link:acceptFrom', [<referrers>])`.
|
|
139
139
|
|
|
140
140
|
Given that you want to ensure the clientId remains consistent when you navigate from a source page on http://foo.com/index.html to a target page http://bar.com/index.html, the following steps are needed.
|
|
141
141
|
|
|
@@ -185,9 +185,9 @@ To test out your changes, add `coveoua` function calls in the `public/index.html
|
|
|
185
185
|
|
|
186
186
|
Coveo.analytics.js tracks interactions from the same browser client, through a client side provided uuid called a `clientId`. This clientId is initialized on first use and there are multiple options for persisting it's value:
|
|
187
187
|
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
188
|
+
- Cookie storage, which supports top level domain storage. This means that the clientId for a.foo.com will be identical to the one on b.foo.com.
|
|
189
|
+
- Local storage, which allows to store much more information client side, but has the drawback of not being able to access data across multiple top level domains.
|
|
190
|
+
- Session storage, which has roughly the same limitation and capability as Local storage, except that it is cleared when the web browser tab is closed.
|
|
191
191
|
|
|
192
192
|
By default, coveoua will use both local storage and cookie storage to persist its clientId. If your environment does not support local persistence, it's possible to write your own storage abstraction.
|
|
193
193
|
|
|
@@ -195,9 +195,9 @@ By default, coveoua will use both local storage and cookie storage to persist it
|
|
|
195
195
|
|
|
196
196
|
Since React Native does not run inside a browser, it cannot use cookies or the local/session storage that modern browsers provide. You must provide your own Storage implementation. Thankfully, there exist multiple packages to store data:
|
|
197
197
|
|
|
198
|
-
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
198
|
+
- [React native community AsyncStorage](https://github.com/react-native-async-storage/async-storage) (recommended)
|
|
199
|
+
- [React native AsyncStorage](https://reactnative.dev/docs/asyncstorage) (deprecated)
|
|
200
|
+
- [Expo Secure Store](https://docs.expo.dev/versions/latest/sdk/securestore/)
|
|
201
201
|
|
|
202
202
|
A sample React native storage class implementation could look as follows
|
|
203
203
|
|
package/dist/browser.mjs
CHANGED
|
@@ -12,7 +12,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
12
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
14
14
|
***************************************************************************** */
|
|
15
|
-
/* global Reflect, Promise */
|
|
15
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
function __rest(s, e) {
|
|
@@ -35,7 +35,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
35
35
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
36
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
37
|
});
|
|
38
|
-
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
41
|
+
var e = new Error(message);
|
|
42
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
43
|
+
};
|
|
39
44
|
|
|
40
45
|
var EventType;
|
|
41
46
|
(function (EventType) {
|
|
@@ -372,7 +377,7 @@ for (let i = 0; i < 256; ++i) {
|
|
|
372
377
|
function unsafeStringify(arr, offset = 0) {
|
|
373
378
|
// Note: Be careful editing this code! It's been tuned for performance
|
|
374
379
|
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
375
|
-
return
|
|
380
|
+
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
376
381
|
}
|
|
377
382
|
|
|
378
383
|
function parse(uuid) {
|
|
@@ -598,7 +603,7 @@ function sha1(bytes) {
|
|
|
598
603
|
const v5 = v35('v5', 0x50, sha1);
|
|
599
604
|
var uuidv5 = v5;
|
|
600
605
|
|
|
601
|
-
const libVersion = "2.30.
|
|
606
|
+
const libVersion = "2.30.46";
|
|
602
607
|
|
|
603
608
|
const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
|
|
604
609
|
|
|
@@ -1537,8 +1542,8 @@ class CoveoAnalyticsClient {
|
|
|
1537
1542
|
});
|
|
1538
1543
|
}
|
|
1539
1544
|
sendSearchEvent(_a) {
|
|
1540
|
-
var { searchQueryUid } = _a, preparedRequest = __rest(_a, ["searchQueryUid"]);
|
|
1541
1545
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1546
|
+
var { searchQueryUid } = _a, preparedRequest = __rest(_a, ["searchQueryUid"]);
|
|
1542
1547
|
return (yield this.makeSearchEvent(preparedRequest)).log({ searchQueryUid });
|
|
1543
1548
|
});
|
|
1544
1549
|
}
|
|
@@ -1548,8 +1553,8 @@ class CoveoAnalyticsClient {
|
|
|
1548
1553
|
});
|
|
1549
1554
|
}
|
|
1550
1555
|
sendClickEvent(_a) {
|
|
1551
|
-
var { searchQueryUid } = _a, preparedRequest = __rest(_a, ["searchQueryUid"]);
|
|
1552
1556
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1557
|
+
var { searchQueryUid } = _a, preparedRequest = __rest(_a, ["searchQueryUid"]);
|
|
1553
1558
|
return (yield this.makeClickEvent(preparedRequest)).log({ searchQueryUid });
|
|
1554
1559
|
});
|
|
1555
1560
|
}
|
|
@@ -1559,8 +1564,8 @@ class CoveoAnalyticsClient {
|
|
|
1559
1564
|
});
|
|
1560
1565
|
}
|
|
1561
1566
|
sendCustomEvent(_a) {
|
|
1562
|
-
var { lastSearchQueryUid } = _a, preparedRequest = __rest(_a, ["lastSearchQueryUid"]);
|
|
1563
1567
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1568
|
+
var { lastSearchQueryUid } = _a, preparedRequest = __rest(_a, ["lastSearchQueryUid"]);
|
|
1564
1569
|
return (yield this.makeCustomEvent(preparedRequest)).log({ lastSearchQueryUid });
|
|
1565
1570
|
});
|
|
1566
1571
|
}
|
|
@@ -1834,7 +1839,6 @@ const CustomEventsTypes = {
|
|
|
1834
1839
|
[SearchPageEvents.triggerExecute]: 'queryPipelineTriggers',
|
|
1835
1840
|
[SearchPageEvents.triggerQuery]: 'queryPipelineTriggers',
|
|
1836
1841
|
[SearchPageEvents.triggerRedirect]: 'queryPipelineTriggers',
|
|
1837
|
-
[SearchPageEvents.queryError]: 'errors',
|
|
1838
1842
|
[SearchPageEvents.queryErrorBack]: 'errors',
|
|
1839
1843
|
[SearchPageEvents.queryErrorClear]: 'errors',
|
|
1840
1844
|
[SearchPageEvents.queryErrorRetry]: 'errors',
|
|
@@ -2582,8 +2586,8 @@ class CoveoSearchPageClient {
|
|
|
2582
2586
|
var _a;
|
|
2583
2587
|
return { actionCause, customData: (_a = preparedEvent.payload) === null || _a === void 0 ? void 0 : _a.customData };
|
|
2584
2588
|
}
|
|
2585
|
-
makeCustomEvent(
|
|
2586
|
-
return __awaiter(this,
|
|
2589
|
+
makeCustomEvent(event_1, metadata_1) {
|
|
2590
|
+
return __awaiter(this, arguments, void 0, function* (event, metadata, eventType = CustomEventsTypes[event]) {
|
|
2587
2591
|
this.coveoAnalyticsClient.getParameters;
|
|
2588
2592
|
const customData = Object.assign(Object.assign({}, this.provider.getBaseMetadata()), metadata);
|
|
2589
2593
|
const request = Object.assign(Object.assign({}, (yield this.getBaseEventRequest(customData))), { eventType, eventValue: event });
|
|
@@ -2594,8 +2598,8 @@ class CoveoSearchPageClient {
|
|
|
2594
2598
|
};
|
|
2595
2599
|
});
|
|
2596
2600
|
}
|
|
2597
|
-
logCustomEvent(
|
|
2598
|
-
return __awaiter(this,
|
|
2601
|
+
logCustomEvent(event_1, metadata_1) {
|
|
2602
|
+
return __awaiter(this, arguments, void 0, function* (event, metadata, eventType = CustomEventsTypes[event]) {
|
|
2599
2603
|
return (yield this.makeCustomEvent(event, metadata, eventType)).log({ searchUID: this.provider.getSearchUID() });
|
|
2600
2604
|
});
|
|
2601
2605
|
}
|
|
@@ -2651,8 +2655,8 @@ class CoveoSearchPageClient {
|
|
|
2651
2655
|
});
|
|
2652
2656
|
}
|
|
2653
2657
|
getBaseSearchEventRequest(event, metadata) {
|
|
2654
|
-
var _a, _b;
|
|
2655
2658
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2659
|
+
var _a, _b;
|
|
2656
2660
|
return Object.assign(Object.assign(Object.assign({}, (yield this.getBaseEventRequest(Object.assign(Object.assign({}, metadata), (_b = (_a = this.provider).getGeneratedAnswerMetadata) === null || _b === void 0 ? void 0 : _b.call(_a))))), this.provider.getSearchEventRequestPayload()), { queryPipeline: this.provider.getPipeline(), actionCause: event });
|
|
2657
2661
|
});
|
|
2658
2662
|
}
|
|
@@ -3004,8 +3008,8 @@ class CaseAssistClient {
|
|
|
3004
3008
|
: null);
|
|
3005
3009
|
}
|
|
3006
3010
|
getBaseEventRequest(metadata) {
|
|
3007
|
-
var _a, _b;
|
|
3008
3011
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3012
|
+
var _a, _b;
|
|
3009
3013
|
const customData = Object.assign({}, metadata);
|
|
3010
3014
|
return Object.assign(Object.assign({}, this.getOrigins()), { customData, language: (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getLanguage(), anonymous: (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getIsAnonymous(), clientId: yield this.getClientId() });
|
|
3011
3015
|
});
|
|
@@ -3025,8 +3029,8 @@ class CaseAssistClient {
|
|
|
3025
3029
|
};
|
|
3026
3030
|
}
|
|
3027
3031
|
logClickEvent(event, info, identifier, metadata) {
|
|
3028
|
-
var _a, _b;
|
|
3029
3032
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3033
|
+
var _a, _b;
|
|
3030
3034
|
const payload = Object.assign(Object.assign(Object.assign({}, info), (yield this.getBaseEventRequest(Object.assign(Object.assign({}, identifier), metadata)))), { searchQueryUid: (_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSearchUID()) !== null && _b !== void 0 ? _b : '', actionCause: event });
|
|
3031
3035
|
return this.coveoAnalyticsClient.sendClickEvent(payload);
|
|
3032
3036
|
});
|
|
@@ -3072,6 +3076,20 @@ class CoveoInsightClient {
|
|
|
3072
3076
|
}
|
|
3073
3077
|
return this.logSearchEvent(SearchPageEvents.interfaceLoad);
|
|
3074
3078
|
}
|
|
3079
|
+
logRecentQueryClick(metadata) {
|
|
3080
|
+
if (metadata) {
|
|
3081
|
+
const metadataToSend = generateMetadataToSend(metadata);
|
|
3082
|
+
return this.logSearchEvent(SearchPageEvents.recentQueryClick, metadataToSend);
|
|
3083
|
+
}
|
|
3084
|
+
return this.logSearchEvent(SearchPageEvents.recentQueryClick);
|
|
3085
|
+
}
|
|
3086
|
+
logClearRecentQueries(metadata) {
|
|
3087
|
+
if (metadata) {
|
|
3088
|
+
const metadataToSend = generateMetadataToSend(metadata);
|
|
3089
|
+
return this.logCustomEvent(SearchPageEvents.clearRecentQueries, metadataToSend);
|
|
3090
|
+
}
|
|
3091
|
+
return this.logCustomEvent(SearchPageEvents.clearRecentQueries);
|
|
3092
|
+
}
|
|
3075
3093
|
logInterfaceChange(metadata) {
|
|
3076
3094
|
const metadataToSend = generateMetadataToSend(metadata);
|
|
3077
3095
|
return this.logSearchEvent(SearchPageEvents.interfaceChange, metadataToSend);
|
|
@@ -3365,8 +3383,8 @@ class CoveoInsightClient {
|
|
|
3365
3383
|
});
|
|
3366
3384
|
}
|
|
3367
3385
|
getBaseSearchEventRequest(event, metadata) {
|
|
3368
|
-
var _a, _b;
|
|
3369
3386
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3387
|
+
var _a, _b;
|
|
3370
3388
|
return Object.assign(Object.assign(Object.assign({}, (yield this.getBaseEventRequest(Object.assign(Object.assign({}, metadata), (_b = (_a = this.provider).getGeneratedAnswerMetadata) === null || _b === void 0 ? void 0 : _b.call(_a))))), this.provider.getSearchEventRequestPayload()), { searchQueryUid: this.provider.getSearchUID(), queryPipeline: this.provider.getPipeline(), actionCause: event });
|
|
3371
3389
|
});
|
|
3372
3390
|
}
|