coveo.analytics 2.20.16 → 2.20.19

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.
@@ -21,6 +21,7 @@ export declare type EventTypeConfig = {
21
21
  newEventType: EventType;
22
22
  variableLengthArgumentsNames?: string[];
23
23
  addVisitorIdParameter?: boolean;
24
+ addClientIdParameter?: boolean;
24
25
  usesMeasurementProtocol?: boolean;
25
26
  };
26
27
  export interface AnalyticsClient {
@@ -38,6 +39,7 @@ export interface AnalyticsClient {
38
39
  addEventTypeMapping(eventType: string, eventConfig: EventTypeConfig): void;
39
40
  runtime: IRuntimeEnvironment;
40
41
  readonly currentVisitorId: string;
42
+ getCurrentVisitorId?(): Promise<string>;
41
43
  }
42
44
  export interface BufferedRequest {
43
45
  eventType: EventType;
@@ -1,6 +1,6 @@
1
1
  import { ClientOptions, AnalyticsClient } from '../client/analytics';
2
2
  import { SearchEventRequest } from '../events';
3
- import { SearchPageEvents, OmniboxSuggestionsMetadata, FacetMetadata, FacetRangeMetadata, CategoryFacetMetadata, DocumentIdentifier, InterfaceChangeMetadata, ResultsSortMetadata, PartialDocumentInformation, TriggerNotifyMetadata, TriggerExecuteMetadata, TriggerRedirectMetadata, PagerResizeMetadata, PagerMetadata, FacetBaseMeta, FacetSortMeta, QueryErrorMeta, FacetStateMetadata, SmartSnippetFeedbackReason, SmartSnippetSuggestionMeta, SmartSnippetDocumentIdentifier, StaticFilterMetadata, StaticFilterToggleValueMetadata } from './searchPageEvents';
3
+ import { SearchPageEvents, OmniboxSuggestionsMetadata, FacetMetadata, FacetRangeMetadata, CategoryFacetMetadata, DocumentIdentifier, InterfaceChangeMetadata, ResultsSortMetadata, PartialDocumentInformation, TriggerNotifyMetadata, TriggerExecuteMetadata, TriggerRedirectMetadata, PagerResizeMetadata, PagerMetadata, FacetBaseMeta, FacetSortMeta, QueryErrorMeta, FacetStateMetadata, SmartSnippetFeedbackReason, SmartSnippetSuggestionMeta, SmartSnippetDocumentIdentifier, StaticFilterMetadata, StaticFilterToggleValueMetadata, UndoTriggerRedirectMetadata } from './searchPageEvents';
4
4
  export interface SearchPageClientProvider {
5
5
  getBaseMetadata: () => Record<string, any>;
6
6
  getSearchEventRequestPayload: () => Omit<SearchEventRequest, 'actionCause' | 'searchQueryUid'>;
@@ -51,6 +51,7 @@ export declare class CoveoSearchPageClient {
51
51
  logTriggerNotify(meta: TriggerNotifyMetadata): Promise<void | import("../events").CustomEventResponse>;
52
52
  logTriggerExecute(meta: TriggerExecuteMetadata): Promise<void | import("../events").CustomEventResponse>;
53
53
  logTriggerQuery(): Promise<void | import("../events").CustomEventResponse>;
54
+ logUndoTriggerQuery(meta: UndoTriggerRedirectMetadata): Promise<void | import("../events").SearchEventResponse>;
54
55
  logTriggerRedirect(meta: TriggerRedirectMetadata): Promise<void | import("../events").CustomEventResponse>;
55
56
  logPagerResize(meta: PagerResizeMetadata): Promise<void | import("../events").CustomEventResponse>;
56
57
  logPagerNumber(meta: PagerMetadata): Promise<void | import("../events").CustomEventResponse>;
@@ -19,6 +19,7 @@ export declare enum SearchPageEvents {
19
19
  triggerNotify = "notify",
20
20
  triggerExecute = "execute",
21
21
  triggerQuery = "query",
22
+ undoTriggerQuery = "undoQuery",
22
23
  triggerRedirect = "redirect",
23
24
  pagerResize = "pagerResize",
24
25
  pagerNumber = "pagerNumber",
@@ -118,6 +119,9 @@ export interface TriggerNotifyMetadata {
118
119
  export interface TriggerExecuteMetadata {
119
120
  executed: string;
120
121
  }
122
+ export interface UndoTriggerRedirectMetadata {
123
+ undoneQuery: string;
124
+ }
121
125
  export interface TriggerRedirectMetadata {
122
126
  redirectedTo: string;
123
127
  }
@@ -879,13 +879,19 @@ class CoveoAnalyticsClient {
879
879
  }
880
880
  resolveParameters(eventType, ...payload) {
881
881
  return __awaiter(this, void 0, void 0, function* () {
882
- const { variableLengthArgumentsNames = [], addVisitorIdParameter = false, usesMeasurementProtocol = false } = this.eventTypeMapping[eventType] || {};
882
+ const { variableLengthArgumentsNames = [], addVisitorIdParameter = false, usesMeasurementProtocol = false, addClientIdParameter = false, } = this.eventTypeMapping[eventType] || {};
883
883
  const processVariableArgumentNamesStep = (currentPayload) => variableLengthArgumentsNames.length > 0
884
884
  ? this.parseVariableArgumentsPayload(variableLengthArgumentsNames, currentPayload)
885
885
  : currentPayload[0];
886
886
  const addVisitorIdStep = (currentPayload) => __awaiter(this, void 0, void 0, function* () {
887
887
  return (Object.assign(Object.assign({}, currentPayload), { visitorId: addVisitorIdParameter ? yield this.getCurrentVisitorId() : '' }));
888
888
  });
889
+ const addClientIdStep = (currentPayload) => __awaiter(this, void 0, void 0, function* () {
890
+ if (addClientIdParameter) {
891
+ return Object.assign(Object.assign({}, currentPayload), { clientId: yield this.getCurrentVisitorId() });
892
+ }
893
+ return currentPayload;
894
+ });
889
895
  const setAnonymousUserStep = (currentPayload) => usesMeasurementProtocol ? this.ensureAnonymousUserWhenUsingApiKey(currentPayload) : currentPayload;
890
896
  const processBeforeSendHooksStep = (currentPayload) => this.beforeSendHooks.reduce((promisePayload, current) => __awaiter(this, void 0, void 0, function* () {
891
897
  const payload = yield promisePayload;
@@ -894,6 +900,7 @@ class CoveoAnalyticsClient {
894
900
  const parametersToSend = yield [
895
901
  processVariableArgumentNamesStep,
896
902
  addVisitorIdStep,
903
+ addClientIdStep,
897
904
  setAnonymousUserStep,
898
905
  processBeforeSendHooksStep,
899
906
  ].reduce((payloadPromise, step) => __awaiter(this, void 0, void 0, function* () {
@@ -1102,6 +1109,7 @@ var SearchPageEvents;
1102
1109
  SearchPageEvents["triggerNotify"] = "notify";
1103
1110
  SearchPageEvents["triggerExecute"] = "execute";
1104
1111
  SearchPageEvents["triggerQuery"] = "query";
1112
+ SearchPageEvents["undoTriggerQuery"] = "undoQuery";
1105
1113
  SearchPageEvents["triggerRedirect"] = "redirect";
1106
1114
  SearchPageEvents["pagerResize"] = "pagerResize";
1107
1115
  SearchPageEvents["pagerNumber"] = "pagerNumber";
@@ -1350,6 +1358,9 @@ class CoveoSearchPageClient {
1350
1358
  const meta = { query: this.provider.getSearchEventRequestPayload().queryText };
1351
1359
  return this.logCustomEvent(SearchPageEvents.triggerQuery, meta);
1352
1360
  }
1361
+ logUndoTriggerQuery(meta) {
1362
+ return this.logSearchEvent(SearchPageEvents.undoTriggerQuery, meta);
1363
+ }
1353
1364
  logTriggerRedirect(meta) {
1354
1365
  const allMeta = Object.assign(Object.assign({}, meta), { query: this.provider.getSearchEventRequestPayload().queryText });
1355
1366
  return this.logCustomEvent(SearchPageEvents.triggerRedirect, allMeta);
package/dist/library.js CHANGED
@@ -82696,12 +82696,12 @@ var CoveoAnalyticsClient = (function () {
82696
82696
  payload[_i - 1] = arguments[_i];
82697
82697
  }
82698
82698
  return __awaiter(this, void 0, void 0, function () {
82699
- var _a, _b, variableLengthArgumentsNames, _c, addVisitorIdParameter, _d, usesMeasurementProtocol, processVariableArgumentNamesStep, addVisitorIdStep, setAnonymousUserStep, processBeforeSendHooksStep, parametersToSend;
82699
+ var _a, _b, variableLengthArgumentsNames, _c, addVisitorIdParameter, _d, usesMeasurementProtocol, _e, addClientIdParameter, processVariableArgumentNamesStep, addVisitorIdStep, addClientIdStep, setAnonymousUserStep, processBeforeSendHooksStep, parametersToSend;
82700
82700
  var _this = this;
82701
- return __generator(this, function (_e) {
82702
- switch (_e.label) {
82701
+ return __generator(this, function (_f) {
82702
+ switch (_f.label) {
82703
82703
  case 0:
82704
- _a = this.eventTypeMapping[eventType] || {}, _b = _a.variableLengthArgumentsNames, variableLengthArgumentsNames = _b === void 0 ? [] : _b, _c = _a.addVisitorIdParameter, addVisitorIdParameter = _c === void 0 ? false : _c, _d = _a.usesMeasurementProtocol, usesMeasurementProtocol = _d === void 0 ? false : _d;
82704
+ _a = this.eventTypeMapping[eventType] || {}, _b = _a.variableLengthArgumentsNames, variableLengthArgumentsNames = _b === void 0 ? [] : _b, _c = _a.addVisitorIdParameter, addVisitorIdParameter = _c === void 0 ? false : _c, _d = _a.usesMeasurementProtocol, usesMeasurementProtocol = _d === void 0 ? false : _d, _e = _a.addClientIdParameter, addClientIdParameter = _e === void 0 ? false : _e;
82705
82705
  processVariableArgumentNamesStep = function (currentPayload) {
82706
82706
  return variableLengthArgumentsNames.length > 0
82707
82707
  ? _this.parseVariableArgumentsPayload(variableLengthArgumentsNames, currentPayload)
@@ -82726,6 +82726,20 @@ var CoveoAnalyticsClient = (function () {
82726
82726
  }
82727
82727
  });
82728
82728
  }); };
82729
+ addClientIdStep = function (currentPayload) { return __awaiter(_this, void 0, void 0, function () {
82730
+ var _a, _b;
82731
+ return __generator(this, function (_c) {
82732
+ switch (_c.label) {
82733
+ case 0:
82734
+ if (!addClientIdParameter) return [3, 2];
82735
+ _a = [__assign({}, currentPayload)];
82736
+ _b = {};
82737
+ return [4, this.getCurrentVisitorId()];
82738
+ case 1: return [2, __assign.apply(void 0, _a.concat([(_b.clientId = _c.sent(), _b)]))];
82739
+ case 2: return [2, currentPayload];
82740
+ }
82741
+ });
82742
+ }); };
82729
82743
  setAnonymousUserStep = function (currentPayload) {
82730
82744
  return usesMeasurementProtocol ? _this.ensureAnonymousUserWhenUsingApiKey(currentPayload) : currentPayload;
82731
82745
  };
@@ -82746,6 +82760,7 @@ var CoveoAnalyticsClient = (function () {
82746
82760
  return [4, [
82747
82761
  processVariableArgumentNamesStep,
82748
82762
  addVisitorIdStep,
82763
+ addClientIdStep,
82749
82764
  setAnonymousUserStep,
82750
82765
  processBeforeSendHooksStep,
82751
82766
  ].reduce(function (payloadPromise, step) { return __awaiter(_this, void 0, void 0, function () {
@@ -82761,7 +82776,7 @@ var CoveoAnalyticsClient = (function () {
82761
82776
  });
82762
82777
  }); }, Promise.resolve(payload))];
82763
82778
  case 1:
82764
- parametersToSend = _e.sent();
82779
+ parametersToSend = _f.sent();
82765
82780
  return [2, parametersToSend];
82766
82781
  }
82767
82782
  });
@@ -83397,6 +83412,7 @@ var CoveoUA = (function () {
83397
83412
  return _this.plugins.require(pluginKey, pluginOptions_1);
83398
83413
  });
83399
83414
  this.client.registerBeforeSendEventHook(function (eventType, payload) { return (__assign(__assign({}, payload), _this.params)); });
83415
+ this.client.addEventTypeMapping(EventType.view, { newEventType: EventType.view, addClientIdParameter: true });
83400
83416
  }
83401
83417
  else {
83402
83418
  throw new Error("You must pass either your token or a valid object when you call 'init'");
@@ -83553,6 +83569,7 @@ var SearchPageEvents;
83553
83569
  SearchPageEvents["triggerNotify"] = "notify";
83554
83570
  SearchPageEvents["triggerExecute"] = "execute";
83555
83571
  SearchPageEvents["triggerQuery"] = "query";
83572
+ SearchPageEvents["undoTriggerQuery"] = "undoQuery";
83556
83573
  SearchPageEvents["triggerRedirect"] = "redirect";
83557
83574
  SearchPageEvents["pagerResize"] = "pagerResize";
83558
83575
  SearchPageEvents["pagerNumber"] = "pagerNumber";
@@ -83802,6 +83819,9 @@ var CoveoSearchPageClient = (function () {
83802
83819
  var meta = { query: this.provider.getSearchEventRequestPayload().queryText };
83803
83820
  return this.logCustomEvent(SearchPageEvents.triggerQuery, meta);
83804
83821
  };
83822
+ CoveoSearchPageClient.prototype.logUndoTriggerQuery = function (meta) {
83823
+ return this.logSearchEvent(SearchPageEvents.undoTriggerQuery, meta);
83824
+ };
83805
83825
  CoveoSearchPageClient.prototype.logTriggerRedirect = function (meta) {
83806
83826
  var allMeta = __assign(__assign({}, meta), { query: this.provider.getSearchEventRequestPayload().queryText });
83807
83827
  return this.logCustomEvent(SearchPageEvents.triggerRedirect, allMeta);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coveo.analytics",
3
- "version": "2.20.16",
3
+ "version": "2.20.19",
4
4
  "description": "📈 Coveo analytics client (node and browser compatible) ",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.es.js",
@@ -54,6 +54,7 @@ export type EventTypeConfig = {
54
54
  newEventType: EventType;
55
55
  variableLengthArgumentsNames?: string[];
56
56
  addVisitorIdParameter?: boolean;
57
+ addClientIdParameter?: boolean;
57
58
  usesMeasurementProtocol?: boolean;
58
59
  };
59
60
 
@@ -75,6 +76,7 @@ export interface AnalyticsClient {
75
76
  * @deprecated
76
77
  */
77
78
  readonly currentVisitorId: string;
79
+ getCurrentVisitorId?(): Promise<string>; // TODO: v3 make required
78
80
  }
79
81
 
80
82
  export interface BufferedRequest {
@@ -205,8 +207,12 @@ export class CoveoAnalyticsClient implements AnalyticsClient, VisitorIdProvider
205
207
  }
206
208
 
207
209
  async resolveParameters(eventType: EventType | string, ...payload: VariableArgumentsPayload) {
208
- const {variableLengthArgumentsNames = [], addVisitorIdParameter = false, usesMeasurementProtocol = false} =
209
- this.eventTypeMapping[eventType] || {};
210
+ const {
211
+ variableLengthArgumentsNames = [],
212
+ addVisitorIdParameter = false,
213
+ usesMeasurementProtocol = false,
214
+ addClientIdParameter = false,
215
+ } = this.eventTypeMapping[eventType] || {};
210
216
 
211
217
  const processVariableArgumentNamesStep: ProcessPayloadStep = (currentPayload) =>
212
218
  variableLengthArgumentsNames.length > 0
@@ -216,6 +222,15 @@ export class CoveoAnalyticsClient implements AnalyticsClient, VisitorIdProvider
216
222
  ...currentPayload,
217
223
  visitorId: addVisitorIdParameter ? await this.getCurrentVisitorId() : '',
218
224
  });
225
+ const addClientIdStep: AsyncProcessPayloadStep = async (currentPayload) => {
226
+ if (addClientIdParameter) {
227
+ return {
228
+ ...currentPayload,
229
+ clientId: await this.getCurrentVisitorId(),
230
+ };
231
+ }
232
+ return currentPayload;
233
+ };
219
234
  const setAnonymousUserStep: ProcessPayloadStep = (currentPayload) =>
220
235
  usesMeasurementProtocol ? this.ensureAnonymousUserWhenUsingApiKey(currentPayload) : currentPayload;
221
236
  const processBeforeSendHooksStep: AsyncProcessPayloadStep = (currentPayload) =>
@@ -227,6 +242,7 @@ export class CoveoAnalyticsClient implements AnalyticsClient, VisitorIdProvider
227
242
  const parametersToSend = await [
228
243
  processVariableArgumentNamesStep,
229
244
  addVisitorIdStep,
245
+ addClientIdStep,
230
246
  setAnonymousUserStep,
231
247
  processBeforeSendHooksStep,
232
248
  ].reduce(async (payloadPromise, step) => {
@@ -1,11 +1,12 @@
1
1
  import {handleOneAnalyticsEvent} from './simpleanalytics';
2
- import {createAnalyticsClientMock} from '../../tests/analyticsClientMock';
2
+ import {createAnalyticsClientMock, visitorIdMock} from '../../tests/analyticsClientMock';
3
3
  import {EC} from '../plugins/ec';
4
4
  import {SVC} from '../plugins/svc';
5
5
  import {TestPlugin} from '../../tests/pluginMock';
6
6
  import {uuidv4} from '../client/crypto';
7
7
  import {PluginOptions} from '../plugins/BasePlugin';
8
8
  import {mockFetch} from '../../tests/fetchMock';
9
+ import {CookieStorage} from '../storage';
9
10
 
10
11
  jest.mock('../plugins/svc', () => {
11
12
  const SVC = jest.fn().mockImplementation(() => {});
@@ -22,6 +23,11 @@ jest.mock('../plugins/ec', () => {
22
23
  };
23
24
  });
24
25
 
26
+ const uuidv4Mock = jest.fn();
27
+ jest.mock('../client/crypto', () => ({
28
+ uuidv4: () => uuidv4Mock(),
29
+ }));
30
+
25
31
  const {fetchMock, fetchMockBeforeEach} = mockFetch();
26
32
 
27
33
  class TestPluginWithSpy extends TestPlugin {
@@ -46,7 +52,10 @@ describe('simpleanalytics', () => {
46
52
  jest.clearAllMocks();
47
53
  fetchMockBeforeEach();
48
54
 
55
+ new CookieStorage().removeItem('visitorId');
56
+ localStorage.clear();
49
57
  fetchMock.mock('*', {});
58
+ uuidv4Mock.mockImplementationOnce(() => visitorIdMock);
50
59
  handleOneAnalyticsEvent('reset');
51
60
  });
52
61
 
@@ -199,7 +208,16 @@ describe('simpleanalytics', () => {
199
208
 
200
209
  expect(fetchMock.calls().length).toBe(1);
201
210
  expect(fetchMock.lastUrl()).toBe(`${analyticsEndpoint}/pageview`);
202
- expect(JSON.parse(fetchMock.lastCall()[1].body.toString())).toEqual({somedata: 'asd'});
211
+ expect(JSON.parse(fetchMock.lastCall()![1]!.body!.toString())).toEqual({somedata: 'asd'});
212
+ });
213
+
214
+ it('can send view event with clientId', async () => {
215
+ handleOneAnalyticsEvent('init', 'MYTOKEN', {plugins: []});
216
+ await handleOneAnalyticsEvent('send', 'view');
217
+
218
+ expect(fetchMock.calls().length).toBe(1);
219
+ expect(fetchMock.lastUrl()).toBe(`${analyticsEndpoint}/view?visitor=${visitorIdMock}`);
220
+ expect(JSON.parse(fetchMock.lastCall()![1]!.body!.toString()).clientId).toBe(visitorIdMock);
203
221
  });
204
222
 
205
223
  it('can send any event to the endpoint', async () => {
@@ -227,7 +245,7 @@ describe('simpleanalytics', () => {
227
245
 
228
246
  expect(fetchMock.calls().length).toBe(1);
229
247
  expect(fetchMock.lastUrl()).toBe(`${analyticsEndpoint}/${someRandomEventName}`);
230
- expect(JSON.parse(fetchMock.lastCall()[1].body.toString())).toEqual({userId: 'something'});
248
+ expect(JSON.parse(fetchMock.lastCall()![1]!.body!.toString())).toEqual({userId: 'something'});
231
249
  });
232
250
 
233
251
  it('can set parameters using an object', async () => {
@@ -239,7 +257,7 @@ describe('simpleanalytics', () => {
239
257
 
240
258
  expect(fetchMock.calls().length).toBe(1);
241
259
  expect(fetchMock.lastUrl()).toBe(`${analyticsEndpoint}/${someRandomEventName}`);
242
- expect(JSON.parse(fetchMock.lastCall()[1].body.toString())).toEqual({userId: 'something'});
260
+ expect(JSON.parse(fetchMock.lastCall()![1]!.body!.toString())).toEqual({userId: 'something'});
243
261
  });
244
262
  });
245
263
 
@@ -360,7 +378,7 @@ describe('simpleanalytics', () => {
360
378
 
361
379
  expect(fetchMock.calls().length).toBe(1);
362
380
  expect(fetchMock.lastUrl()).toBe(`${analyticsEndpoint}/${someRandomEventName}`);
363
- expect(JSON.parse(fetchMock.lastCall()[1].body.toString())).toEqual({});
381
+ expect(JSON.parse(fetchMock.lastCall()![1]!.body!.toString())).toEqual({});
364
382
  });
365
383
  });
366
384
 
@@ -1,4 +1,4 @@
1
- import {AnyEventResponse, SendEventArguments, VariableArgumentsPayload} from '../events';
1
+ import {AnyEventResponse, EventType, SendEventArguments, VariableArgumentsPayload} from '../events';
2
2
  import {AnalyticsClient, CoveoAnalyticsClient, Endpoints} from '../client/analytics';
3
3
  import {Plugins} from './plugins';
4
4
  import {PluginOptions} from '../plugins/BasePlugin';
@@ -45,6 +45,7 @@ export class CoveoUA {
45
45
  ...payload,
46
46
  ...this.params,
47
47
  }));
48
+ this.client.addEventTypeMapping(EventType.view, {newEventType: EventType.view, addClientIdParameter: true});
48
49
  } else {
49
50
  throw new Error(`You must pass either your token or a valid object when you call 'init'`);
50
51
  }
@@ -285,6 +285,14 @@ describe('SearchPageClient', () => {
285
285
  expectMatchCustomEventPayload(SearchPageEvents.triggerQuery, meta);
286
286
  });
287
287
 
288
+ it('should send proper payload for #logUndoTriggerQuery', async () => {
289
+ const meta = {
290
+ undoneQuery: 'foo',
291
+ };
292
+ await client.logUndoTriggerQuery(meta);
293
+ expectMatchPayload(SearchPageEvents.undoTriggerQuery, meta);
294
+ });
295
+
288
296
  it('should send proper payload for #logTriggerRedirect', async () => {
289
297
  const meta = {
290
298
  redirectedTo: 'foo',
@@ -25,6 +25,7 @@ import {
25
25
  SmartSnippetDocumentIdentifier,
26
26
  StaticFilterMetadata,
27
27
  StaticFilterToggleValueMetadata,
28
+ UndoTriggerRedirectMetadata,
28
29
  } from './searchPageEvents';
29
30
  import {NoopAnalytics} from '../client/noopAnalytics';
30
31
  import {formatOmniboxMetadata} from '../formatting/format-omnibox-metadata';
@@ -170,6 +171,10 @@ export class CoveoSearchPageClient {
170
171
  return this.logCustomEvent(SearchPageEvents.triggerQuery, meta);
171
172
  }
172
173
 
174
+ public logUndoTriggerQuery(meta: UndoTriggerRedirectMetadata) {
175
+ return this.logSearchEvent(SearchPageEvents.undoTriggerQuery, meta);
176
+ }
177
+
173
178
  public logTriggerRedirect(meta: TriggerRedirectMetadata) {
174
179
  const allMeta = {...meta, query: this.provider.getSearchEventRequestPayload().queryText};
175
180
  return this.logCustomEvent(SearchPageEvents.triggerRedirect, allMeta);
@@ -74,6 +74,10 @@ export enum SearchPageEvents {
74
74
  * Identifies the custom event that gets logged when a user action triggers a new query set in the effective query pipeline on the search page.
75
75
  */
76
76
  triggerQuery = 'query',
77
+ /**
78
+ * Identifies the custom event that gets logged when a user undoes a query set in the effective query pipeline on the search page.
79
+ */
80
+ undoTriggerQuery = 'undoQuery',
77
81
  /**
78
82
  * Identifies the custom event that gets logged when a user action redirects them to a URL set in the effective query pipeline on the search page.
79
83
  */
@@ -363,6 +367,10 @@ export interface TriggerExecuteMetadata {
363
367
  executed: string;
364
368
  }
365
369
 
370
+ export interface UndoTriggerRedirectMetadata {
371
+ undoneQuery: string;
372
+ }
373
+
366
374
  export interface TriggerRedirectMetadata {
367
375
  redirectedTo: string;
368
376
  }