@algolia/client-analytics 5.0.0-alpha.99 → 5.0.0-beta.1

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.
Files changed (186) hide show
  1. package/dist/builds/browser.d.ts +37 -3
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +37 -3
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/client-analytics.cjs +314 -153
  6. package/dist/client-analytics.esm.browser.js +300 -144
  7. package/dist/client-analytics.esm.node.js +314 -153
  8. package/dist/client-analytics.umd.js +2 -2
  9. package/dist/model/clickPositionsInner.d.ts +14 -0
  10. package/dist/model/clickPositionsInner.d.ts.map +1 -0
  11. package/dist/model/clientMethodProps.d.ts +161 -90
  12. package/dist/model/clientMethodProps.d.ts.map +1 -1
  13. package/dist/model/currenciesValue.d.ts +14 -0
  14. package/dist/model/currenciesValue.d.ts.map +1 -0
  15. package/dist/model/dailyAddToCartRates.d.ts +19 -0
  16. package/dist/model/dailyAddToCartRates.d.ts.map +1 -0
  17. package/dist/model/dailyAverageClicks.d.ts +15 -0
  18. package/dist/model/dailyAverageClicks.d.ts.map +1 -0
  19. package/dist/model/dailyClickThroughRates.d.ts +19 -0
  20. package/dist/model/dailyClickThroughRates.d.ts.map +1 -0
  21. package/dist/model/dailyConversionRates.d.ts +19 -0
  22. package/dist/model/dailyConversionRates.d.ts.map +1 -0
  23. package/dist/model/dailyNoClickRates.d.ts +19 -0
  24. package/dist/model/dailyNoClickRates.d.ts.map +1 -0
  25. package/dist/model/dailyNoResultsRates.d.ts +19 -0
  26. package/dist/model/dailyNoResultsRates.d.ts.map +1 -0
  27. package/dist/model/dailyPurchaseRates.d.ts +19 -0
  28. package/dist/model/dailyPurchaseRates.d.ts.map +1 -0
  29. package/dist/model/dailyRevenue.d.ts +12 -0
  30. package/dist/model/dailyRevenue.d.ts.map +1 -0
  31. package/dist/model/dailySearches.d.ts +11 -0
  32. package/dist/model/dailySearches.d.ts.map +1 -0
  33. package/dist/model/dailySearchesNoClicks.d.ts +15 -0
  34. package/dist/model/dailySearchesNoClicks.d.ts.map +1 -0
  35. package/dist/model/dailySearchesNoResults.d.ts +15 -0
  36. package/dist/model/dailySearchesNoResults.d.ts.map +1 -0
  37. package/dist/model/dailyUsers.d.ts +11 -0
  38. package/dist/model/dailyUsers.d.ts.map +1 -0
  39. package/dist/model/getAddToCartRateResponse.d.ts +20 -0
  40. package/dist/model/getAddToCartRateResponse.d.ts.map +1 -0
  41. package/dist/model/getAverageClickPositionResponse.d.ts +6 -6
  42. package/dist/model/getAverageClickPositionResponse.d.ts.map +1 -1
  43. package/dist/model/getClickPositionsResponse.d.ts +3 -3
  44. package/dist/model/getClickPositionsResponse.d.ts.map +1 -1
  45. package/dist/model/getClickThroughRateResponse.d.ts +7 -7
  46. package/dist/model/getClickThroughRateResponse.d.ts.map +1 -1
  47. package/dist/model/getConversionRateResponse.d.ts +20 -0
  48. package/dist/model/getConversionRateResponse.d.ts.map +1 -0
  49. package/dist/model/getNoClickRateResponse.d.ts +6 -6
  50. package/dist/model/getNoClickRateResponse.d.ts.map +1 -1
  51. package/dist/model/getNoResultsRateResponse.d.ts +6 -6
  52. package/dist/model/getNoResultsRateResponse.d.ts.map +1 -1
  53. package/dist/model/getPurchaseRateResponse.d.ts +20 -0
  54. package/dist/model/getPurchaseRateResponse.d.ts.map +1 -0
  55. package/dist/model/getRevenue.d.ts +13 -0
  56. package/dist/model/getRevenue.d.ts.map +1 -0
  57. package/dist/model/getSearchesCountResponse.d.ts +3 -3
  58. package/dist/model/getSearchesCountResponse.d.ts.map +1 -1
  59. package/dist/model/getSearchesNoClicksResponse.d.ts +3 -3
  60. package/dist/model/getSearchesNoClicksResponse.d.ts.map +1 -1
  61. package/dist/model/getSearchesNoResultsResponse.d.ts +3 -3
  62. package/dist/model/getSearchesNoResultsResponse.d.ts.map +1 -1
  63. package/dist/model/getStatusResponse.d.ts +2 -2
  64. package/dist/model/getStatusResponse.d.ts.map +1 -1
  65. package/dist/model/getTopCountriesResponse.d.ts +1 -1
  66. package/dist/model/getTopFilterAttributesResponse.d.ts +1 -1
  67. package/dist/model/getTopFilterForAttribute.d.ts +2 -4
  68. package/dist/model/getTopFilterForAttribute.d.ts.map +1 -1
  69. package/dist/model/getTopFiltersNoResultsResponse.d.ts +2 -2
  70. package/dist/model/getTopFiltersNoResultsResponse.d.ts.map +1 -1
  71. package/dist/model/getTopFiltersNoResultsValue.d.ts +2 -4
  72. package/dist/model/getTopFiltersNoResultsValue.d.ts.map +1 -1
  73. package/dist/model/getTopHitsResponse.d.ts +2 -1
  74. package/dist/model/getTopHitsResponse.d.ts.map +1 -1
  75. package/dist/model/getTopSearchesResponse.d.ts +2 -1
  76. package/dist/model/getTopSearchesResponse.d.ts.map +1 -1
  77. package/dist/model/getUsersCountResponse.d.ts +4 -4
  78. package/dist/model/getUsersCountResponse.d.ts.map +1 -1
  79. package/dist/model/index.d.ts +23 -11
  80. package/dist/model/index.d.ts.map +1 -1
  81. package/dist/model/operator.d.ts +5 -0
  82. package/dist/model/operator.d.ts.map +1 -0
  83. package/dist/model/orderBy.d.ts +1 -1
  84. package/dist/model/topCountry.d.ts +1 -1
  85. package/dist/model/topHit.d.ts +1 -1
  86. package/dist/model/topHitWithAnalytics.d.ts +9 -9
  87. package/dist/model/topHitWithAnalytics.d.ts.map +1 -1
  88. package/dist/model/topHitWithRevenueAnalytics.d.ts +52 -0
  89. package/dist/model/topHitWithRevenueAnalytics.d.ts.map +1 -0
  90. package/dist/model/topHitsResponse.d.ts +1 -1
  91. package/dist/model/topHitsResponseWithAnalytics.d.ts +1 -1
  92. package/dist/model/topHitsResponseWithRevenueAnalytics.d.ts +8 -0
  93. package/dist/model/topHitsResponseWithRevenueAnalytics.d.ts.map +1 -0
  94. package/dist/model/topSearch.d.ts +3 -3
  95. package/dist/model/topSearchWithAnalytics.d.ts +17 -12
  96. package/dist/model/topSearchWithAnalytics.d.ts.map +1 -1
  97. package/dist/model/topSearchWithRevenueAnalytics.d.ts +65 -0
  98. package/dist/model/topSearchWithRevenueAnalytics.d.ts.map +1 -0
  99. package/dist/model/topSearchesResponse.d.ts +1 -1
  100. package/dist/model/topSearchesResponseWithAnalytics.d.ts +1 -1
  101. package/dist/model/topSearchesResponseWithRevenueAnalytics.d.ts +8 -0
  102. package/dist/model/topSearchesResponseWithRevenueAnalytics.d.ts.map +1 -0
  103. package/dist/src/analyticsClient.d.ts +211 -138
  104. package/dist/src/analyticsClient.d.ts.map +1 -1
  105. package/model/clickPositionsInner.ts +16 -0
  106. package/model/clientMethodProps.ts +164 -90
  107. package/model/currenciesValue.ts +16 -0
  108. package/model/dailyAddToCartRates.ts +23 -0
  109. package/model/dailyAverageClicks.ts +18 -0
  110. package/model/dailyClickThroughRates.ts +23 -0
  111. package/model/dailyConversionRates.ts +23 -0
  112. package/model/dailyNoClickRates.ts +23 -0
  113. package/model/dailyNoResultsRates.ts +23 -0
  114. package/model/dailyPurchaseRates.ts +23 -0
  115. package/model/dailyRevenue.ts +15 -0
  116. package/model/{searchEvent.ts → dailySearches.ts} +2 -2
  117. package/model/{searchNoResultEvent.ts → dailySearchesNoClicks.ts} +4 -4
  118. package/model/{searchNoClickEvent.ts → dailySearchesNoResults.ts} +3 -3
  119. package/model/{userWithDate.ts → dailyUsers.ts} +3 -3
  120. package/model/getAddToCartRateResponse.ts +25 -0
  121. package/model/getAverageClickPositionResponse.ts +6 -6
  122. package/model/getClickPositionsResponse.ts +3 -3
  123. package/model/getClickThroughRateResponse.ts +7 -7
  124. package/model/getConversionRateResponse.ts +25 -0
  125. package/model/getNoClickRateResponse.ts +6 -6
  126. package/model/getNoResultsRateResponse.ts +6 -6
  127. package/model/getPurchaseRateResponse.ts +25 -0
  128. package/model/getRevenue.ts +16 -0
  129. package/model/getSearchesCountResponse.ts +3 -3
  130. package/model/getSearchesNoClicksResponse.ts +3 -3
  131. package/model/getSearchesNoResultsResponse.ts +3 -3
  132. package/model/getStatusResponse.ts +2 -2
  133. package/model/getTopCountriesResponse.ts +1 -1
  134. package/model/getTopFilterAttributesResponse.ts +1 -1
  135. package/model/getTopFilterForAttribute.ts +3 -4
  136. package/model/getTopFiltersNoResultsResponse.ts +2 -2
  137. package/model/getTopFiltersNoResultsValue.ts +3 -4
  138. package/model/getTopHitsResponse.ts +5 -1
  139. package/model/getTopSearchesResponse.ts +3 -1
  140. package/model/getUsersCountResponse.ts +4 -4
  141. package/model/index.ts +23 -11
  142. package/model/operator.ts +6 -0
  143. package/model/orderBy.ts +1 -1
  144. package/model/topCountry.ts +1 -1
  145. package/model/topHit.ts +1 -1
  146. package/model/topHitWithAnalytics.ts +9 -9
  147. package/model/topHitWithRevenueAnalytics.ts +65 -0
  148. package/model/topHitsResponse.ts +1 -1
  149. package/model/topHitsResponseWithAnalytics.ts +1 -1
  150. package/model/topHitsResponseWithRevenueAnalytics.ts +10 -0
  151. package/model/topSearch.ts +3 -3
  152. package/model/topSearchWithAnalytics.ts +19 -12
  153. package/model/topSearchWithRevenueAnalytics.ts +81 -0
  154. package/model/topSearchesResponse.ts +1 -1
  155. package/model/topSearchesResponseWithAnalytics.ts +1 -1
  156. package/model/topSearchesResponseWithRevenueAnalytics.ts +10 -0
  157. package/package.json +7 -7
  158. package/dist/model/averageClickEvent.d.ts +0 -15
  159. package/dist/model/averageClickEvent.d.ts.map +0 -1
  160. package/dist/model/clickPosition.d.ts +0 -11
  161. package/dist/model/clickPosition.d.ts.map +0 -1
  162. package/dist/model/clickThroughRateEvent.d.ts +0 -19
  163. package/dist/model/clickThroughRateEvent.d.ts.map +0 -1
  164. package/dist/model/conversionRateEvent.d.ts +0 -19
  165. package/dist/model/conversionRateEvent.d.ts.map +0 -1
  166. package/dist/model/getConversationRateResponse.d.ts +0 -20
  167. package/dist/model/getConversationRateResponse.d.ts.map +0 -1
  168. package/dist/model/noClickRateEvent.d.ts +0 -19
  169. package/dist/model/noClickRateEvent.d.ts.map +0 -1
  170. package/dist/model/noResultsRateEvent.d.ts +0 -19
  171. package/dist/model/noResultsRateEvent.d.ts.map +0 -1
  172. package/dist/model/searchEvent.d.ts +0 -11
  173. package/dist/model/searchEvent.d.ts.map +0 -1
  174. package/dist/model/searchNoClickEvent.d.ts +0 -15
  175. package/dist/model/searchNoClickEvent.d.ts.map +0 -1
  176. package/dist/model/searchNoResultEvent.d.ts +0 -15
  177. package/dist/model/searchNoResultEvent.d.ts.map +0 -1
  178. package/dist/model/userWithDate.d.ts +0 -11
  179. package/dist/model/userWithDate.d.ts.map +0 -1
  180. package/model/averageClickEvent.ts +0 -18
  181. package/model/clickPosition.ts +0 -13
  182. package/model/clickThroughRateEvent.ts +0 -23
  183. package/model/conversionRateEvent.ts +0 -23
  184. package/model/getConversationRateResponse.ts +0 -25
  185. package/model/noClickRateEvent.ts +0 -23
  186. package/model/noResultsRateEvent.ts +0 -23
@@ -207,7 +207,7 @@ function _toPrimitive(t, r) {
207
207
  }
208
208
  function _toPropertyKey(t) {
209
209
  var i = _toPrimitive(t, "string");
210
- return "symbol" == typeof i ? i : String(i);
210
+ return "symbol" == typeof i ? i : i + "";
211
211
  }
212
212
  function _defineProperty(obj, key, value) {
213
213
  key = _toPropertyKey(key);
@@ -270,7 +270,7 @@ class DetailedApiError extends ApiError {
270
270
  }
271
271
  function serializeUrl(host, path, queryParameters) {
272
272
  const queryParametersAsString = serializeQueryParameters(queryParameters);
273
- let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`;
273
+ let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;
274
274
  if (queryParametersAsString.length) {
275
275
  url += `?${queryParametersAsString}`;
276
276
  }
@@ -278,7 +278,7 @@ function serializeUrl(host, path, queryParameters) {
278
278
  }
279
279
  function serializeQueryParameters(parameters) {
280
280
  const isObjectOrArray = value => Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';
281
- return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])}`).join('&');
281
+ return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]).replaceAll('+', '%20')}`).join('&');
282
282
  }
283
283
  function serializeData(request, requestOptions) {
284
284
  if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
@@ -449,16 +449,13 @@ function createTransporter({
449
449
  if (host === undefined) {
450
450
  throw new RetryError(stackTraceWithoutCredentials(stackTrace));
451
451
  }
452
- let responseTimeout = requestOptions.timeout;
453
- if (responseTimeout === undefined) {
454
- responseTimeout = isRead ? timeouts.read : timeouts.write;
455
- }
452
+ let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
456
453
  const payload = {
457
454
  data,
458
455
  headers,
459
456
  method: request.method,
460
457
  url: serializeUrl(host, request.path, queryParameters),
461
- connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
458
+ connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
462
459
  responseTimeout: getTimeout(timeoutsCount, responseTimeout)
463
460
  };
464
461
  /**
@@ -686,7 +683,7 @@ function createXhrRequester() {
686
683
  }
687
684
 
688
685
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
689
- const apiClientVersion = '5.0.0-alpha.99';
686
+ const apiClientVersion = '5.0.0-beta.1';
690
687
  const REGIONS = ['de', 'us'];
691
688
  function getDefaultHosts(region) {
692
689
  const url = !region
@@ -748,7 +745,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
748
745
  /**
749
746
  * This method allow you to send requests to the Algolia REST API.
750
747
  *
751
- * @summary Send requests to the Algolia REST API.
752
748
  * @param customDelete - The customDelete object.
753
749
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
754
750
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -758,7 +754,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
758
754
  if (!path) {
759
755
  throw new Error('Parameter `path` is required when calling `customDelete`.');
760
756
  }
761
- const requestPath = '/1{path}'.replace('{path}', path);
757
+ const requestPath = '/{path}'.replace('{path}', path);
762
758
  const headers = {};
763
759
  const queryParameters = parameters ? parameters : {};
764
760
  const request = {
@@ -772,7 +768,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
772
768
  /**
773
769
  * This method allow you to send requests to the Algolia REST API.
774
770
  *
775
- * @summary Send requests to the Algolia REST API.
776
771
  * @param customGet - The customGet object.
777
772
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
778
773
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -782,7 +777,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
782
777
  if (!path) {
783
778
  throw new Error('Parameter `path` is required when calling `customGet`.');
784
779
  }
785
- const requestPath = '/1{path}'.replace('{path}', path);
780
+ const requestPath = '/{path}'.replace('{path}', path);
786
781
  const headers = {};
787
782
  const queryParameters = parameters ? parameters : {};
788
783
  const request = {
@@ -796,7 +791,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
796
791
  /**
797
792
  * This method allow you to send requests to the Algolia REST API.
798
793
  *
799
- * @summary Send requests to the Algolia REST API.
800
794
  * @param customPost - The customPost object.
801
795
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
802
796
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -807,7 +801,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
807
801
  if (!path) {
808
802
  throw new Error('Parameter `path` is required when calling `customPost`.');
809
803
  }
810
- const requestPath = '/1{path}'.replace('{path}', path);
804
+ const requestPath = '/{path}'.replace('{path}', path);
811
805
  const headers = {};
812
806
  const queryParameters = parameters ? parameters : {};
813
807
  const request = {
@@ -822,7 +816,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
822
816
  /**
823
817
  * This method allow you to send requests to the Algolia REST API.
824
818
  *
825
- * @summary Send requests to the Algolia REST API.
826
819
  * @param customPut - The customPut object.
827
820
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
828
821
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -833,7 +826,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
833
826
  if (!path) {
834
827
  throw new Error('Parameter `path` is required when calling `customPut`.');
835
828
  }
836
- const requestPath = '/1{path}'.replace('{path}', path);
829
+ const requestPath = '/{path}'.replace('{path}', path);
837
830
  const headers = {};
838
831
  const queryParameters = parameters ? parameters : {};
839
832
  const request = {
@@ -846,14 +839,56 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
846
839
  return transporter.request(request, requestOptions);
847
840
  },
848
841
  /**
849
- * Return the average click position for the complete time range and for individual days. > **Note**: If all `positions` have a `clickCount` of `0` or `null`, it means Algolia didn\'t receive any click events for tracked searches. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`.
842
+ * Retrieves the add-to-cart rate for all of your searches with at least one add-to-cart event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
843
+ *
844
+ * Required API Key ACLs:
845
+ * - analytics.
846
+ *
847
+ * @param getAddToCartRate - The getAddToCartRate object.
848
+ * @param getAddToCartRate.index - Index name.
849
+ * @param getAddToCartRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
850
+ * @param getAddToCartRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
851
+ * @param getAddToCartRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
852
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
853
+ */
854
+ getAddToCartRate({ index, startDate, endDate, tags }, requestOptions) {
855
+ if (!index) {
856
+ throw new Error('Parameter `index` is required when calling `getAddToCartRate`.');
857
+ }
858
+ const requestPath = '/2/conversions/addToCartRate';
859
+ const headers = {};
860
+ const queryParameters = {};
861
+ if (index !== undefined) {
862
+ queryParameters.index = index.toString();
863
+ }
864
+ if (startDate !== undefined) {
865
+ queryParameters.startDate = startDate.toString();
866
+ }
867
+ if (endDate !== undefined) {
868
+ queryParameters.endDate = endDate.toString();
869
+ }
870
+ if (tags !== undefined) {
871
+ queryParameters.tags = tags.toString();
872
+ }
873
+ const request = {
874
+ method: 'GET',
875
+ path: requestPath,
876
+ queryParameters,
877
+ headers,
878
+ };
879
+ return transporter.request(request, requestOptions);
880
+ },
881
+ /**
882
+ * Retrieves the average click position of your search results, including a daily breakdown. The average click position is the average of all clicked search results\' positions. For example, if users only ever click on the first result for any search, the average click position is 1. By default, the analyzed period includes the last eight days including the current day.
883
+ *
884
+ * Required API Key ACLs:
885
+ * - analytics.
850
886
  *
851
- * @summary Get average click position.
852
887
  * @param getAverageClickPosition - The getAverageClickPosition object.
853
- * @param getAverageClickPosition.index - Index name to target.
854
- * @param getAverageClickPosition.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
855
- * @param getAverageClickPosition.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
856
- * @param getAverageClickPosition.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
888
+ * @param getAverageClickPosition.index - Index name.
889
+ * @param getAverageClickPosition.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
890
+ * @param getAverageClickPosition.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
891
+ * @param getAverageClickPosition.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
857
892
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
858
893
  */
859
894
  getAverageClickPosition({ index, startDate, endDate, tags }, requestOptions) {
@@ -884,14 +919,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
884
919
  return transporter.request(request, requestOptions);
885
920
  },
886
921
  /**
887
- * Show the number of clicks events and their associated position in the search results. > **Note**: If all `positions` have a `clickCount` of `0` or `null`, it means Algolia didn\'t receive any click events for tracked searches. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`.
922
+ * Retrieves the positions in the search results and their associated number of clicks. This lets you check how many clicks the first, second, or tenth search results receive.
923
+ *
924
+ * Required API Key ACLs:
925
+ * - analytics.
888
926
  *
889
- * @summary Get click positions.
890
927
  * @param getClickPositions - The getClickPositions object.
891
- * @param getClickPositions.index - Index name to target.
892
- * @param getClickPositions.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
893
- * @param getClickPositions.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
894
- * @param getClickPositions.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
928
+ * @param getClickPositions.index - Index name.
929
+ * @param getClickPositions.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
930
+ * @param getClickPositions.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
931
+ * @param getClickPositions.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
895
932
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
896
933
  */
897
934
  getClickPositions({ index, startDate, endDate, tags }, requestOptions) {
@@ -922,14 +959,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
922
959
  return transporter.request(request, requestOptions);
923
960
  },
924
961
  /**
925
- * Returns a [click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
962
+ * Retrieves the click-through rate for all of your searches with at least one click event, including a daily breakdown By default, the analyzed period includes the last eight days including the current day.
963
+ *
964
+ * Required API Key ACLs:
965
+ * - analytics.
926
966
  *
927
- * @summary Get click-through rate (CTR).
928
967
  * @param getClickThroughRate - The getClickThroughRate object.
929
- * @param getClickThroughRate.index - Index name to target.
930
- * @param getClickThroughRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
931
- * @param getClickThroughRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
932
- * @param getClickThroughRate.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
968
+ * @param getClickThroughRate.index - Index name.
969
+ * @param getClickThroughRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
970
+ * @param getClickThroughRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
971
+ * @param getClickThroughRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
933
972
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
934
973
  */
935
974
  getClickThroughRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -960,19 +999,21 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
960
999
  return transporter.request(request, requestOptions);
961
1000
  },
962
1001
  /**
963
- * Return a [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
1002
+ * Retrieves the conversion rate for all of your searches with at least one conversion event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
1003
+ *
1004
+ * Required API Key ACLs:
1005
+ * - analytics.
964
1006
  *
965
- * @summary Get conversion rate (CR).
966
- * @param getConversationRate - The getConversationRate object.
967
- * @param getConversationRate.index - Index name to target.
968
- * @param getConversationRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
969
- * @param getConversationRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
970
- * @param getConversationRate.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1007
+ * @param getConversionRate - The getConversionRate object.
1008
+ * @param getConversionRate.index - Index name.
1009
+ * @param getConversionRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1010
+ * @param getConversionRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1011
+ * @param getConversionRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
971
1012
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
972
1013
  */
973
- getConversationRate({ index, startDate, endDate, tags }, requestOptions) {
1014
+ getConversionRate({ index, startDate, endDate, tags }, requestOptions) {
974
1015
  if (!index) {
975
- throw new Error('Parameter `index` is required when calling `getConversationRate`.');
1016
+ throw new Error('Parameter `index` is required when calling `getConversionRate`.');
976
1017
  }
977
1018
  const requestPath = '/2/conversions/conversionRate';
978
1019
  const headers = {};
@@ -998,14 +1039,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
998
1039
  return transporter.request(request, requestOptions);
999
1040
  },
1000
1041
  /**
1001
- * Returns the rate at which searches don\'t lead to any clicks. The endpoint returns a value for the complete given time range, as well as a value per day. It also returns the count of searches and searches without clicks.
1042
+ * Retrieves the fraction of searches that didn\'t lead to any click within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
1043
+ *
1044
+ * Required API Key ACLs:
1045
+ * - analytics.
1002
1046
  *
1003
- * @summary Get no click rate.
1004
1047
  * @param getNoClickRate - The getNoClickRate object.
1005
- * @param getNoClickRate.index - Index name to target.
1006
- * @param getNoClickRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1007
- * @param getNoClickRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1008
- * @param getNoClickRate.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1048
+ * @param getNoClickRate.index - Index name.
1049
+ * @param getNoClickRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1050
+ * @param getNoClickRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1051
+ * @param getNoClickRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1009
1052
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1010
1053
  */
1011
1054
  getNoClickRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -1036,14 +1079,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1036
1079
  return transporter.request(request, requestOptions);
1037
1080
  },
1038
1081
  /**
1039
- * Returns the rate at which searches didn\'t return any results.
1082
+ * Retrieves the fraction of searches that didn\'t return any results within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
1083
+ *
1084
+ * Required API Key ACLs:
1085
+ * - analytics.
1040
1086
  *
1041
- * @summary Get no results rate.
1042
1087
  * @param getNoResultsRate - The getNoResultsRate object.
1043
- * @param getNoResultsRate.index - Index name to target.
1044
- * @param getNoResultsRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1045
- * @param getNoResultsRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1046
- * @param getNoResultsRate.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1088
+ * @param getNoResultsRate.index - Index name.
1089
+ * @param getNoResultsRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1090
+ * @param getNoResultsRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1091
+ * @param getNoResultsRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1047
1092
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1048
1093
  */
1049
1094
  getNoResultsRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -1074,14 +1119,96 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1074
1119
  return transporter.request(request, requestOptions);
1075
1120
  },
1076
1121
  /**
1077
- * Returns the number of searches within a time range.
1122
+ * Retrieves the purchase rate for all of your searches with at least one purchase event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
1123
+ *
1124
+ * Required API Key ACLs:
1125
+ * - analytics.
1126
+ *
1127
+ * @param getPurchaseRate - The getPurchaseRate object.
1128
+ * @param getPurchaseRate.index - Index name.
1129
+ * @param getPurchaseRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1130
+ * @param getPurchaseRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1131
+ * @param getPurchaseRate.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1132
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1133
+ */
1134
+ getPurchaseRate({ index, startDate, endDate, tags }, requestOptions) {
1135
+ if (!index) {
1136
+ throw new Error('Parameter `index` is required when calling `getPurchaseRate`.');
1137
+ }
1138
+ const requestPath = '/2/conversions/purchaseRate';
1139
+ const headers = {};
1140
+ const queryParameters = {};
1141
+ if (index !== undefined) {
1142
+ queryParameters.index = index.toString();
1143
+ }
1144
+ if (startDate !== undefined) {
1145
+ queryParameters.startDate = startDate.toString();
1146
+ }
1147
+ if (endDate !== undefined) {
1148
+ queryParameters.endDate = endDate.toString();
1149
+ }
1150
+ if (tags !== undefined) {
1151
+ queryParameters.tags = tags.toString();
1152
+ }
1153
+ const request = {
1154
+ method: 'GET',
1155
+ path: requestPath,
1156
+ queryParameters,
1157
+ headers,
1158
+ };
1159
+ return transporter.request(request, requestOptions);
1160
+ },
1161
+ /**
1162
+ * Retrieves revenue-related metrics, such as the total revenue or the average order value. To retrieve revenue-related metrics, sent purchase events. By default, the analyzed period includes the last eight days including the current day.
1163
+ *
1164
+ * Required API Key ACLs:
1165
+ * - analytics.
1166
+ *
1167
+ * @param getRevenue - The getRevenue object.
1168
+ * @param getRevenue.index - Index name.
1169
+ * @param getRevenue.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1170
+ * @param getRevenue.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1171
+ * @param getRevenue.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1172
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1173
+ */
1174
+ getRevenue({ index, startDate, endDate, tags }, requestOptions) {
1175
+ if (!index) {
1176
+ throw new Error('Parameter `index` is required when calling `getRevenue`.');
1177
+ }
1178
+ const requestPath = '/2/conversions/revenue';
1179
+ const headers = {};
1180
+ const queryParameters = {};
1181
+ if (index !== undefined) {
1182
+ queryParameters.index = index.toString();
1183
+ }
1184
+ if (startDate !== undefined) {
1185
+ queryParameters.startDate = startDate.toString();
1186
+ }
1187
+ if (endDate !== undefined) {
1188
+ queryParameters.endDate = endDate.toString();
1189
+ }
1190
+ if (tags !== undefined) {
1191
+ queryParameters.tags = tags.toString();
1192
+ }
1193
+ const request = {
1194
+ method: 'GET',
1195
+ path: requestPath,
1196
+ queryParameters,
1197
+ headers,
1198
+ };
1199
+ return transporter.request(request, requestOptions);
1200
+ },
1201
+ /**
1202
+ * Retrieves the number of searches within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
1203
+ *
1204
+ * Required API Key ACLs:
1205
+ * - analytics.
1078
1206
  *
1079
- * @summary Get number of searches.
1080
1207
  * @param getSearchesCount - The getSearchesCount object.
1081
- * @param getSearchesCount.index - Index name to target.
1082
- * @param getSearchesCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1083
- * @param getSearchesCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1084
- * @param getSearchesCount.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1208
+ * @param getSearchesCount.index - Index name.
1209
+ * @param getSearchesCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1210
+ * @param getSearchesCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1211
+ * @param getSearchesCount.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1085
1212
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1086
1213
  */
1087
1214
  getSearchesCount({ index, startDate, endDate, tags }, requestOptions) {
@@ -1112,16 +1239,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1112
1239
  return transporter.request(request, requestOptions);
1113
1240
  },
1114
1241
  /**
1115
- * Return the most popular of the last 1,000 searches that didn\'t lead to any clicks.
1242
+ * Retrieves the most popular searches that didn\'t lead to any clicks, from the 1,000 most frequent searches.
1243
+ *
1244
+ * Required API Key ACLs:
1245
+ * - analytics.
1116
1246
  *
1117
- * @summary Get top searches with no clicks.
1118
1247
  * @param getSearchesNoClicks - The getSearchesNoClicks object.
1119
- * @param getSearchesNoClicks.index - Index name to target.
1120
- * @param getSearchesNoClicks.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1121
- * @param getSearchesNoClicks.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1122
- * @param getSearchesNoClicks.limit - Number of records to return (page size).
1123
- * @param getSearchesNoClicks.offset - Position of the starting record. Used for paging. 0 is the first record.
1124
- * @param getSearchesNoClicks.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1248
+ * @param getSearchesNoClicks.index - Index name.
1249
+ * @param getSearchesNoClicks.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1250
+ * @param getSearchesNoClicks.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1251
+ * @param getSearchesNoClicks.limit - Number of items to return.
1252
+ * @param getSearchesNoClicks.offset - Position of the first item to return.
1253
+ * @param getSearchesNoClicks.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1125
1254
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1126
1255
  */
1127
1256
  getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1158,16 +1287,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1158
1287
  return transporter.request(request, requestOptions);
1159
1288
  },
1160
1289
  /**
1161
- * Returns the most popular of the latest 1,000 searches that didn\'t return any results.
1290
+ * Retrieves the most popular searches that didn\'t return any results.
1291
+ *
1292
+ * Required API Key ACLs:
1293
+ * - analytics.
1162
1294
  *
1163
- * @summary Get top searches with no results.
1164
1295
  * @param getSearchesNoResults - The getSearchesNoResults object.
1165
- * @param getSearchesNoResults.index - Index name to target.
1166
- * @param getSearchesNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1167
- * @param getSearchesNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1168
- * @param getSearchesNoResults.limit - Number of records to return (page size).
1169
- * @param getSearchesNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
1170
- * @param getSearchesNoResults.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1296
+ * @param getSearchesNoResults.index - Index name.
1297
+ * @param getSearchesNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1298
+ * @param getSearchesNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1299
+ * @param getSearchesNoResults.limit - Number of items to return.
1300
+ * @param getSearchesNoResults.offset - Position of the first item to return.
1301
+ * @param getSearchesNoResults.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1171
1302
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1172
1303
  */
1173
1304
  getSearchesNoResults({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1204,11 +1335,13 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1204
1335
  return transporter.request(request, requestOptions);
1205
1336
  },
1206
1337
  /**
1207
- * Return the latest update time of the Analytics API for an index. If the index has been recently created or no search has been performed yet, `updatedAt` will be `null`. > **Note**: The Analytics API is updated every 5 minutes.
1338
+ * Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.
1339
+ *
1340
+ * Required API Key ACLs:
1341
+ * - analytics.
1208
1342
  *
1209
- * @summary Get Analytics API status.
1210
1343
  * @param getStatus - The getStatus object.
1211
- * @param getStatus.index - Index name to target.
1344
+ * @param getStatus.index - Index name.
1212
1345
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1213
1346
  */
1214
1347
  getStatus({ index }, requestOptions) {
@@ -1230,16 +1363,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1230
1363
  return transporter.request(request, requestOptions);
1231
1364
  },
1232
1365
  /**
1233
- * Returns top countries. Limited to the 1,000 most frequent ones.
1366
+ * Retrieves the countries with the most searches to your index.
1367
+ *
1368
+ * Required API Key ACLs:
1369
+ * - analytics.
1234
1370
  *
1235
- * @summary Get top countries.
1236
1371
  * @param getTopCountries - The getTopCountries object.
1237
- * @param getTopCountries.index - Index name to target.
1238
- * @param getTopCountries.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1239
- * @param getTopCountries.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1240
- * @param getTopCountries.limit - Number of records to return (page size).
1241
- * @param getTopCountries.offset - Position of the starting record. Used for paging. 0 is the first record.
1242
- * @param getTopCountries.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1372
+ * @param getTopCountries.index - Index name.
1373
+ * @param getTopCountries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1374
+ * @param getTopCountries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1375
+ * @param getTopCountries.limit - Number of items to return.
1376
+ * @param getTopCountries.offset - Position of the first item to return.
1377
+ * @param getTopCountries.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1243
1378
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1244
1379
  */
1245
1380
  getTopCountries({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
@@ -1276,17 +1411,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1276
1411
  return transporter.request(request, requestOptions);
1277
1412
  },
1278
1413
  /**
1279
- * Return the most popular [filterable attributes](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) in the 1,000 most recently used filters.
1414
+ * Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting.
1415
+ *
1416
+ * Required API Key ACLs:
1417
+ * - analytics.
1280
1418
  *
1281
- * @summary Get top filterable attributes.
1282
1419
  * @param getTopFilterAttributes - The getTopFilterAttributes object.
1283
- * @param getTopFilterAttributes.index - Index name to target.
1284
- * @param getTopFilterAttributes.search - User query.
1285
- * @param getTopFilterAttributes.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1286
- * @param getTopFilterAttributes.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1287
- * @param getTopFilterAttributes.limit - Number of records to return (page size).
1288
- * @param getTopFilterAttributes.offset - Position of the starting record. Used for paging. 0 is the first record.
1289
- * @param getTopFilterAttributes.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1420
+ * @param getTopFilterAttributes.index - Index name.
1421
+ * @param getTopFilterAttributes.search - Search query.
1422
+ * @param getTopFilterAttributes.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1423
+ * @param getTopFilterAttributes.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1424
+ * @param getTopFilterAttributes.limit - Number of items to return.
1425
+ * @param getTopFilterAttributes.offset - Position of the first item to return.
1426
+ * @param getTopFilterAttributes.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1290
1427
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1291
1428
  */
1292
1429
  getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1326,18 +1463,20 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1326
1463
  return transporter.request(request, requestOptions);
1327
1464
  },
1328
1465
  /**
1329
- * Returns the most popular filter values for an attribute in the 1,000 most recently used filters.
1466
+ * Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting.
1467
+ *
1468
+ * Required API Key ACLs:
1469
+ * - analytics.
1330
1470
  *
1331
- * @summary Get top filter values for an attribute.
1332
1471
  * @param getTopFilterForAttribute - The getTopFilterForAttribute object.
1333
1472
  * @param getTopFilterForAttribute.attribute - Attribute name.
1334
- * @param getTopFilterForAttribute.index - Index name to target.
1335
- * @param getTopFilterForAttribute.search - User query.
1336
- * @param getTopFilterForAttribute.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1337
- * @param getTopFilterForAttribute.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1338
- * @param getTopFilterForAttribute.limit - Number of records to return (page size).
1339
- * @param getTopFilterForAttribute.offset - Position of the starting record. Used for paging. 0 is the first record.
1340
- * @param getTopFilterForAttribute.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1473
+ * @param getTopFilterForAttribute.index - Index name.
1474
+ * @param getTopFilterForAttribute.search - Search query.
1475
+ * @param getTopFilterForAttribute.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1476
+ * @param getTopFilterForAttribute.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1477
+ * @param getTopFilterForAttribute.limit - Number of items to return.
1478
+ * @param getTopFilterForAttribute.offset - Position of the first item to return.
1479
+ * @param getTopFilterForAttribute.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1341
1480
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1342
1481
  */
1343
1482
  getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1380,17 +1519,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1380
1519
  return transporter.request(request, requestOptions);
1381
1520
  },
1382
1521
  /**
1383
- * Returns top filters for filter-enabled searches that don\'t return results. Limited to the 1,000 most recently used filters.
1522
+ * Retrieves the most frequently used filters for a search that didn\'t return any results. To get the most frequent searches without results, use the [Retrieve searches without results](#tag/search/operation/getSearchesNoResults) operation.
1523
+ *
1524
+ * Required API Key ACLs:
1525
+ * - analytics.
1384
1526
  *
1385
- * @summary Get top filters for a no result search.
1386
1527
  * @param getTopFiltersNoResults - The getTopFiltersNoResults object.
1387
- * @param getTopFiltersNoResults.index - Index name to target.
1388
- * @param getTopFiltersNoResults.search - User query.
1389
- * @param getTopFiltersNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1390
- * @param getTopFiltersNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1391
- * @param getTopFiltersNoResults.limit - Number of records to return (page size).
1392
- * @param getTopFiltersNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
1393
- * @param getTopFiltersNoResults.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1528
+ * @param getTopFiltersNoResults.index - Index name.
1529
+ * @param getTopFiltersNoResults.search - Search query.
1530
+ * @param getTopFiltersNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1531
+ * @param getTopFiltersNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1532
+ * @param getTopFiltersNoResults.limit - Number of items to return.
1533
+ * @param getTopFiltersNoResults.offset - Position of the first item to return.
1534
+ * @param getTopFiltersNoResults.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1394
1535
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1395
1536
  */
1396
1537
  getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1430,21 +1571,24 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1430
1571
  return transporter.request(request, requestOptions);
1431
1572
  },
1432
1573
  /**
1433
- * Return the most popular clicked results in the last 1,000 searches.
1574
+ * Retrieves the object IDs of the most frequent search results.
1575
+ *
1576
+ * Required API Key ACLs:
1577
+ * - analytics.
1434
1578
  *
1435
- * @summary Get top hits.
1436
1579
  * @param getTopHits - The getTopHits object.
1437
- * @param getTopHits.index - Index name to target.
1438
- * @param getTopHits.search - User query.
1439
- * @param getTopHits.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
1440
- * @param getTopHits.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1441
- * @param getTopHits.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1442
- * @param getTopHits.limit - Number of records to return (page size).
1443
- * @param getTopHits.offset - Position of the starting record. Used for paging. 0 is the first record.
1444
- * @param getTopHits.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1580
+ * @param getTopHits.index - Index name.
1581
+ * @param getTopHits.search - Search query.
1582
+ * @param getTopHits.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
1583
+ * @param getTopHits.revenueAnalytics - Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response.
1584
+ * @param getTopHits.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1585
+ * @param getTopHits.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1586
+ * @param getTopHits.limit - Number of items to return.
1587
+ * @param getTopHits.offset - Position of the first item to return.
1588
+ * @param getTopHits.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1445
1589
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1446
1590
  */
1447
- getTopHits({ index, search, clickAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
1591
+ getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
1448
1592
  if (!index) {
1449
1593
  throw new Error('Parameter `index` is required when calling `getTopHits`.');
1450
1594
  }
@@ -1460,6 +1604,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1460
1604
  if (clickAnalytics !== undefined) {
1461
1605
  queryParameters.clickAnalytics = clickAnalytics.toString();
1462
1606
  }
1607
+ if (revenueAnalytics !== undefined) {
1608
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
1609
+ }
1463
1610
  if (startDate !== undefined) {
1464
1611
  queryParameters.startDate = startDate.toString();
1465
1612
  }
@@ -1484,22 +1631,25 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1484
1631
  return transporter.request(request, requestOptions);
1485
1632
  },
1486
1633
  /**
1487
- * Returns the most popular of the latest 1,000 searches. For each search, also returns the number of hits.
1634
+ * Returns the most popular search terms.
1635
+ *
1636
+ * Required API Key ACLs:
1637
+ * - analytics.
1488
1638
  *
1489
- * @summary Get top searches.
1490
1639
  * @param getTopSearches - The getTopSearches object.
1491
- * @param getTopSearches.index - Index name to target.
1492
- * @param getTopSearches.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
1493
- * @param getTopSearches.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1494
- * @param getTopSearches.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1495
- * @param getTopSearches.orderBy - Reorder the results.
1640
+ * @param getTopSearches.index - Index name.
1641
+ * @param getTopSearches.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
1642
+ * @param getTopSearches.revenueAnalytics - Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response.
1643
+ * @param getTopSearches.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1644
+ * @param getTopSearches.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1645
+ * @param getTopSearches.orderBy - Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.
1496
1646
  * @param getTopSearches.direction - Sorting direction of the results: ascending or descending.
1497
- * @param getTopSearches.limit - Number of records to return (page size).
1498
- * @param getTopSearches.offset - Position of the starting record. Used for paging. 0 is the first record.
1499
- * @param getTopSearches.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1647
+ * @param getTopSearches.limit - Number of items to return.
1648
+ * @param getTopSearches.offset - Position of the first item to return.
1649
+ * @param getTopSearches.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1500
1650
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1501
1651
  */
1502
- getTopSearches({ index, clickAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
1652
+ getTopSearches({ index, clickAnalytics, revenueAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
1503
1653
  if (!index) {
1504
1654
  throw new Error('Parameter `index` is required when calling `getTopSearches`.');
1505
1655
  }
@@ -1512,6 +1662,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1512
1662
  if (clickAnalytics !== undefined) {
1513
1663
  queryParameters.clickAnalytics = clickAnalytics.toString();
1514
1664
  }
1665
+ if (revenueAnalytics !== undefined) {
1666
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
1667
+ }
1515
1668
  if (startDate !== undefined) {
1516
1669
  queryParameters.startDate = startDate.toString();
1517
1670
  }
@@ -1542,14 +1695,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1542
1695
  return transporter.request(request, requestOptions);
1543
1696
  },
1544
1697
  /**
1545
- * Return the count of unique users.
1698
+ * Retrieves the number of unique users within a time range, including a daily breakdown. Since this endpoint returns the number of unique users, the sum of the daily values might be different from the total number. By default, Algolia distinguishes search users by their IP address, _unless_ you include a pseudonymous user identifier in your search requests with the `userToken` API parameter or `x-algolia-usertoken` request header. By default, the analyzed period includes the last eight days including the current day.
1699
+ *
1700
+ * Required API Key ACLs:
1701
+ * - analytics.
1546
1702
  *
1547
- * @summary Get user count.
1548
1703
  * @param getUsersCount - The getUsersCount object.
1549
- * @param getUsersCount.index - Index name to target.
1550
- * @param getUsersCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1551
- * @param getUsersCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
1552
- * @param getUsersCount.tags - Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded.
1704
+ * @param getUsersCount.index - Index name.
1705
+ * @param getUsersCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1706
+ * @param getUsersCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1707
+ * @param getUsersCount.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
1553
1708
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1554
1709
  */
1555
1710
  getUsersCount({ index, startDate, endDate, tags }, requestOptions) {
@@ -1583,6 +1738,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1583
1738
  }
1584
1739
 
1585
1740
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
1741
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
1586
1742
  function analyticsClient(appId, apiKey, region, options) {
1587
1743
  if (!appId || typeof appId !== 'string') {
1588
1744
  throw new Error('`appId` is missing.');