coveo.analytics 2.28.21 → 2.28.23

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/browser.mjs CHANGED
@@ -596,7 +596,7 @@ function sha1(bytes) {
596
596
  const v5 = v35('v5', 0x50, sha1);
597
597
  var uuidv5 = v5;
598
598
 
599
- const libVersion = "2.28.21" ;
599
+ const libVersion = "2.28.23" ;
600
600
 
601
601
  const getFormattedLocation = (location) => `${location.protocol}//${location.hostname}${location.pathname.indexOf('/') === 0 ? location.pathname : `/${location.pathname}`}${location.search}`;
602
602
 
@@ -1279,6 +1279,10 @@ class CoveoAnalyticsClient {
1279
1279
  this.clear();
1280
1280
  this.runtime.storage = new NullStorage();
1281
1281
  }
1282
+ this.addEventTypeMapping(EventType.view, { newEventType: EventType.view, addClientIdParameter: true });
1283
+ this.addEventTypeMapping(EventType.click, { newEventType: EventType.click, addClientIdParameter: true });
1284
+ this.addEventTypeMapping(EventType.custom, { newEventType: EventType.custom, addClientIdParameter: true });
1285
+ this.addEventTypeMapping(EventType.search, { newEventType: EventType.search, addClientIdParameter: true });
1282
1286
  }
1283
1287
  initRuntime(clientsOptions) {
1284
1288
  if (hasWindow() && hasDocument()) {
@@ -1689,6 +1693,7 @@ var InsightEvents;
1689
1693
  InsightEvents["showFollowingSessions"] = "showFollowingSessions";
1690
1694
  InsightEvents["clickViewedDocument"] = "clickViewedDocument";
1691
1695
  InsightEvents["clickPageView"] = "clickPageView";
1696
+ InsightEvents["createArticle"] = "createArticle";
1692
1697
  })(InsightEvents || (InsightEvents = {}));
1693
1698
 
1694
1699
  var SearchPageEvents;
@@ -1810,12 +1815,6 @@ const CustomEventsTypes = {
1810
1815
  [SearchPageEvents.recentResultClick]: 'recentlyClickedDocuments',
1811
1816
  [SearchPageEvents.clearRecentResults]: 'recentlyClickedDocuments',
1812
1817
  [SearchPageEvents.showLessFoldedResults]: 'folding',
1813
- [InsightEvents.expandToFullUI]: 'interface',
1814
- [InsightEvents.openUserActions]: 'User Actions',
1815
- [InsightEvents.showPrecedingSessions]: 'User Actions',
1816
- [InsightEvents.showFollowingSessions]: 'User Actions',
1817
- [InsightEvents.clickViewedDocument]: 'User Actions',
1818
- [InsightEvents.clickPageView]: 'User Actions',
1819
1818
  [SearchPageEvents.caseDetach]: 'case',
1820
1819
  [SearchPageEvents.likeGeneratedAnswer]: 'generatedAnswer',
1821
1820
  [SearchPageEvents.dislikeGeneratedAnswer]: 'generatedAnswer',
@@ -1826,6 +1825,13 @@ const CustomEventsTypes = {
1826
1825
  [SearchPageEvents.generatedAnswerHideAnswers]: 'generatedAnswer',
1827
1826
  [SearchPageEvents.generatedAnswerShowAnswers]: 'generatedAnswer',
1828
1827
  [SearchPageEvents.generatedAnswerFeedbackSubmit]: 'generatedAnswer',
1828
+ [InsightEvents.expandToFullUI]: 'interface',
1829
+ [InsightEvents.openUserActions]: 'User Actions',
1830
+ [InsightEvents.showPrecedingSessions]: 'User Actions',
1831
+ [InsightEvents.showFollowingSessions]: 'User Actions',
1832
+ [InsightEvents.clickViewedDocument]: 'User Actions',
1833
+ [InsightEvents.clickPageView]: 'User Actions',
1834
+ [InsightEvents.createArticle]: 'createArticle',
1829
1835
  };
1830
1836
 
1831
1837
  class NoopAnalytics {
@@ -3074,6 +3080,9 @@ class CoveoInsightClient {
3074
3080
  logPageViewClick(pageView, metadata) {
3075
3081
  return this.logCustomEvent(InsightEvents.clickPageView, Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), { pageView }));
3076
3082
  }
3083
+ logCreateArticle(createArticleMetadata, metadata) {
3084
+ return this.logCustomEvent(InsightEvents.createArticle, metadata ? Object.assign(Object.assign({}, generateMetadataToSend(metadata, false)), createArticleMetadata) : createArticleMetadata);
3085
+ }
3077
3086
  logDocumentOpen(info, identifier, metadata) {
3078
3087
  return this.logClickEvent(SearchPageEvents.documentOpen, info, identifier, metadata ? generateMetadataToSend(metadata, false) : undefined);
3079
3088
  }