@algolia/client-analytics 5.0.0-alpha.107 → 5.0.0-alpha.109

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 +6 -3
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +6 -3
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/client-analytics.cjs +181 -53
  6. package/dist/client-analytics.esm.browser.js +182 -54
  7. package/dist/client-analytics.esm.node.js +181 -53
  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 +96 -25
  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 +8 -8
  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 +2 -2
  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 +97 -50
  104. package/dist/src/analyticsClient.d.ts.map +1 -1
  105. package/model/clickPositionsInner.ts +16 -0
  106. package/model/clientMethodProps.ts +99 -25
  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} +3 -3
  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 +8 -8
  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 +2 -2
  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);
@@ -686,7 +686,7 @@ function createXhrRequester() {
686
686
  }
687
687
 
688
688
  // 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.107';
689
+ const apiClientVersion = '5.0.0-alpha.109';
690
690
  const REGIONS = ['de', 'us'];
691
691
  function getDefaultHosts(region) {
692
692
  const url = !region
@@ -757,7 +757,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
757
757
  if (!path) {
758
758
  throw new Error('Parameter `path` is required when calling `customDelete`.');
759
759
  }
760
- const requestPath = '/1{path}'.replace('{path}', path);
760
+ const requestPath = '/{path}'.replace('{path}', path);
761
761
  const headers = {};
762
762
  const queryParameters = parameters ? parameters : {};
763
763
  const request = {
@@ -780,7 +780,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
780
780
  if (!path) {
781
781
  throw new Error('Parameter `path` is required when calling `customGet`.');
782
782
  }
783
- const requestPath = '/1{path}'.replace('{path}', path);
783
+ const requestPath = '/{path}'.replace('{path}', path);
784
784
  const headers = {};
785
785
  const queryParameters = parameters ? parameters : {};
786
786
  const request = {
@@ -804,7 +804,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
804
804
  if (!path) {
805
805
  throw new Error('Parameter `path` is required when calling `customPost`.');
806
806
  }
807
- const requestPath = '/1{path}'.replace('{path}', path);
807
+ const requestPath = '/{path}'.replace('{path}', path);
808
808
  const headers = {};
809
809
  const queryParameters = parameters ? parameters : {};
810
810
  const request = {
@@ -829,7 +829,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
829
829
  if (!path) {
830
830
  throw new Error('Parameter `path` is required when calling `customPut`.');
831
831
  }
832
- const requestPath = '/1{path}'.replace('{path}', path);
832
+ const requestPath = '/{path}'.replace('{path}', path);
833
833
  const headers = {};
834
834
  const queryParameters = parameters ? parameters : {};
835
835
  const request = {
@@ -842,7 +842,47 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
842
842
  return transporter.request(request, requestOptions);
843
843
  },
844
844
  /**
845
- * 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`.
845
+ * 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.
846
+ *
847
+ * Required API Key ACLs:
848
+ * - analytics.
849
+ *
850
+ * @param getAddToCartRate - The getAddToCartRate object.
851
+ * @param getAddToCartRate.index - Index name.
852
+ * @param getAddToCartRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
853
+ * @param getAddToCartRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
854
+ * @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/).
855
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
856
+ */
857
+ getAddToCartRate({ index, startDate, endDate, tags }, requestOptions) {
858
+ if (!index) {
859
+ throw new Error('Parameter `index` is required when calling `getAddToCartRate`.');
860
+ }
861
+ const requestPath = '/2/conversions/addToCartRate';
862
+ const headers = {};
863
+ const queryParameters = {};
864
+ if (index !== undefined) {
865
+ queryParameters.index = index.toString();
866
+ }
867
+ if (startDate !== undefined) {
868
+ queryParameters.startDate = startDate.toString();
869
+ }
870
+ if (endDate !== undefined) {
871
+ queryParameters.endDate = endDate.toString();
872
+ }
873
+ if (tags !== undefined) {
874
+ queryParameters.tags = tags.toString();
875
+ }
876
+ const request = {
877
+ method: 'GET',
878
+ path: requestPath,
879
+ queryParameters,
880
+ headers,
881
+ };
882
+ return transporter.request(request, requestOptions);
883
+ },
884
+ /**
885
+ * 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.
846
886
  *
847
887
  * Required API Key ACLs:
848
888
  * - analytics.
@@ -851,7 +891,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
851
891
  * @param getAverageClickPosition.index - Index name.
852
892
  * @param getAverageClickPosition.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
853
893
  * @param getAverageClickPosition.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
854
- * @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.
894
+ * @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/).
855
895
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
856
896
  */
857
897
  getAverageClickPosition({ index, startDate, endDate, tags }, requestOptions) {
@@ -882,7 +922,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
882
922
  return transporter.request(request, requestOptions);
883
923
  },
884
924
  /**
885
- * 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`.
925
+ * 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.
886
926
  *
887
927
  * Required API Key ACLs:
888
928
  * - analytics.
@@ -891,7 +931,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
891
931
  * @param getClickPositions.index - Index name.
892
932
  * @param getClickPositions.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
893
933
  * @param getClickPositions.endDate - End date (`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.
934
+ * @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
935
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
896
936
  */
897
937
  getClickPositions({ index, startDate, endDate, tags }, requestOptions) {
@@ -922,7 +962,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
922
962
  return transporter.request(request, requestOptions);
923
963
  },
924
964
  /**
925
- * Returns a [click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
965
+ * 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.
926
966
  *
927
967
  * Required API Key ACLs:
928
968
  * - analytics.
@@ -931,7 +971,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
931
971
  * @param getClickThroughRate.index - Index name.
932
972
  * @param getClickThroughRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
933
973
  * @param getClickThroughRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
934
- * @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.
974
+ * @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/).
935
975
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
936
976
  */
937
977
  getClickThroughRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -962,21 +1002,21 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
962
1002
  return transporter.request(request, requestOptions);
963
1003
  },
964
1004
  /**
965
- * Return a [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
1005
+ * 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.
966
1006
  *
967
1007
  * Required API Key ACLs:
968
1008
  * - analytics.
969
1009
  *
970
- * @param getConversationRate - The getConversationRate object.
971
- * @param getConversationRate.index - Index name.
972
- * @param getConversationRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
973
- * @param getConversationRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
974
- * @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.
1010
+ * @param getConversionRate - The getConversionRate object.
1011
+ * @param getConversionRate.index - Index name.
1012
+ * @param getConversionRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1013
+ * @param getConversionRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1014
+ * @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/).
975
1015
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
976
1016
  */
977
- getConversationRate({ index, startDate, endDate, tags }, requestOptions) {
1017
+ getConversionRate({ index, startDate, endDate, tags }, requestOptions) {
978
1018
  if (!index) {
979
- throw new Error('Parameter `index` is required when calling `getConversationRate`.');
1019
+ throw new Error('Parameter `index` is required when calling `getConversionRate`.');
980
1020
  }
981
1021
  const requestPath = '/2/conversions/conversionRate';
982
1022
  const headers = {};
@@ -1002,7 +1042,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1002
1042
  return transporter.request(request, requestOptions);
1003
1043
  },
1004
1044
  /**
1005
- * 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.
1045
+ * 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.
1006
1046
  *
1007
1047
  * Required API Key ACLs:
1008
1048
  * - analytics.
@@ -1011,7 +1051,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1011
1051
  * @param getNoClickRate.index - Index name.
1012
1052
  * @param getNoClickRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1013
1053
  * @param getNoClickRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1014
- * @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.
1054
+ * @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/).
1015
1055
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1016
1056
  */
1017
1057
  getNoClickRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -1042,7 +1082,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1042
1082
  return transporter.request(request, requestOptions);
1043
1083
  },
1044
1084
  /**
1045
- * Returns the rate at which searches didn\'t return any results.
1085
+ * 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.
1046
1086
  *
1047
1087
  * Required API Key ACLs:
1048
1088
  * - analytics.
@@ -1051,7 +1091,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1051
1091
  * @param getNoResultsRate.index - Index name.
1052
1092
  * @param getNoResultsRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1053
1093
  * @param getNoResultsRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1054
- * @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.
1094
+ * @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/).
1055
1095
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1056
1096
  */
1057
1097
  getNoResultsRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -1082,7 +1122,87 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1082
1122
  return transporter.request(request, requestOptions);
1083
1123
  },
1084
1124
  /**
1085
- * Returns the number of searches within a time range.
1125
+ * 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.
1126
+ *
1127
+ * Required API Key ACLs:
1128
+ * - analytics.
1129
+ *
1130
+ * @param getPurchaseRate - The getPurchaseRate object.
1131
+ * @param getPurchaseRate.index - Index name.
1132
+ * @param getPurchaseRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1133
+ * @param getPurchaseRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1134
+ * @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/).
1135
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1136
+ */
1137
+ getPurchaseRate({ index, startDate, endDate, tags }, requestOptions) {
1138
+ if (!index) {
1139
+ throw new Error('Parameter `index` is required when calling `getPurchaseRate`.');
1140
+ }
1141
+ const requestPath = '/2/conversions/purchaseRate';
1142
+ const headers = {};
1143
+ const queryParameters = {};
1144
+ if (index !== undefined) {
1145
+ queryParameters.index = index.toString();
1146
+ }
1147
+ if (startDate !== undefined) {
1148
+ queryParameters.startDate = startDate.toString();
1149
+ }
1150
+ if (endDate !== undefined) {
1151
+ queryParameters.endDate = endDate.toString();
1152
+ }
1153
+ if (tags !== undefined) {
1154
+ queryParameters.tags = tags.toString();
1155
+ }
1156
+ const request = {
1157
+ method: 'GET',
1158
+ path: requestPath,
1159
+ queryParameters,
1160
+ headers,
1161
+ };
1162
+ return transporter.request(request, requestOptions);
1163
+ },
1164
+ /**
1165
+ * 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.
1166
+ *
1167
+ * Required API Key ACLs:
1168
+ * - analytics.
1169
+ *
1170
+ * @param getRevenue - The getRevenue object.
1171
+ * @param getRevenue.index - Index name.
1172
+ * @param getRevenue.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1173
+ * @param getRevenue.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1174
+ * @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/).
1175
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1176
+ */
1177
+ getRevenue({ index, startDate, endDate, tags }, requestOptions) {
1178
+ if (!index) {
1179
+ throw new Error('Parameter `index` is required when calling `getRevenue`.');
1180
+ }
1181
+ const requestPath = '/2/conversions/revenue';
1182
+ const headers = {};
1183
+ const queryParameters = {};
1184
+ if (index !== undefined) {
1185
+ queryParameters.index = index.toString();
1186
+ }
1187
+ if (startDate !== undefined) {
1188
+ queryParameters.startDate = startDate.toString();
1189
+ }
1190
+ if (endDate !== undefined) {
1191
+ queryParameters.endDate = endDate.toString();
1192
+ }
1193
+ if (tags !== undefined) {
1194
+ queryParameters.tags = tags.toString();
1195
+ }
1196
+ const request = {
1197
+ method: 'GET',
1198
+ path: requestPath,
1199
+ queryParameters,
1200
+ headers,
1201
+ };
1202
+ return transporter.request(request, requestOptions);
1203
+ },
1204
+ /**
1205
+ * 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.
1086
1206
  *
1087
1207
  * Required API Key ACLs:
1088
1208
  * - analytics.
@@ -1091,7 +1211,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1091
1211
  * @param getSearchesCount.index - Index name.
1092
1212
  * @param getSearchesCount.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1093
1213
  * @param getSearchesCount.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1094
- * @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.
1214
+ * @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/).
1095
1215
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1096
1216
  */
1097
1217
  getSearchesCount({ index, startDate, endDate, tags }, requestOptions) {
@@ -1122,7 +1242,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1122
1242
  return transporter.request(request, requestOptions);
1123
1243
  },
1124
1244
  /**
1125
- * Return the most popular of the last 1,000 searches that didn\'t lead to any clicks.
1245
+ * Retrieves the most popular searches that didn\'t lead to any clicks, from the 1,000 most frequent searches.
1126
1246
  *
1127
1247
  * Required API Key ACLs:
1128
1248
  * - analytics.
@@ -1133,7 +1253,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1133
1253
  * @param getSearchesNoClicks.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1134
1254
  * @param getSearchesNoClicks.limit - Number of items to return.
1135
1255
  * @param getSearchesNoClicks.offset - Position of the first item to return.
1136
- * @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.
1256
+ * @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/).
1137
1257
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1138
1258
  */
1139
1259
  getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1170,7 +1290,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1170
1290
  return transporter.request(request, requestOptions);
1171
1291
  },
1172
1292
  /**
1173
- * Returns the most popular of the latest 1,000 searches that didn\'t return any results.
1293
+ * Retrieves the most popular searches that didn\'t return any results.
1174
1294
  *
1175
1295
  * Required API Key ACLs:
1176
1296
  * - analytics.
@@ -1181,7 +1301,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1181
1301
  * @param getSearchesNoResults.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1182
1302
  * @param getSearchesNoResults.limit - Number of items to return.
1183
1303
  * @param getSearchesNoResults.offset - Position of the first item to return.
1184
- * @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.
1304
+ * @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/).
1185
1305
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1186
1306
  */
1187
1307
  getSearchesNoResults({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1218,7 +1338,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1218
1338
  return transporter.request(request, requestOptions);
1219
1339
  },
1220
1340
  /**
1221
- * 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.
1341
+ * Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.
1222
1342
  *
1223
1343
  * Required API Key ACLs:
1224
1344
  * - analytics.
@@ -1246,7 +1366,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1246
1366
  return transporter.request(request, requestOptions);
1247
1367
  },
1248
1368
  /**
1249
- * Returns top countries. Limited to the 1,000 most frequent ones.
1369
+ * Retrieves the countries with the most searches to your index.
1250
1370
  *
1251
1371
  * Required API Key ACLs:
1252
1372
  * - analytics.
@@ -1257,7 +1377,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1257
1377
  * @param getTopCountries.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1258
1378
  * @param getTopCountries.limit - Number of items to return.
1259
1379
  * @param getTopCountries.offset - Position of the first item to return.
1260
- * @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.
1380
+ * @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/).
1261
1381
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1262
1382
  */
1263
1383
  getTopCountries({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
@@ -1294,19 +1414,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1294
1414
  return transporter.request(request, requestOptions);
1295
1415
  },
1296
1416
  /**
1297
- * 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.
1417
+ * Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting.
1298
1418
  *
1299
1419
  * Required API Key ACLs:
1300
1420
  * - analytics.
1301
1421
  *
1302
1422
  * @param getTopFilterAttributes - The getTopFilterAttributes object.
1303
1423
  * @param getTopFilterAttributes.index - Index name.
1304
- * @param getTopFilterAttributes.search - User query.
1424
+ * @param getTopFilterAttributes.search - Search query.
1305
1425
  * @param getTopFilterAttributes.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1306
1426
  * @param getTopFilterAttributes.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1307
1427
  * @param getTopFilterAttributes.limit - Number of items to return.
1308
1428
  * @param getTopFilterAttributes.offset - Position of the first item to return.
1309
- * @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.
1429
+ * @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/).
1310
1430
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1311
1431
  */
1312
1432
  getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1346,7 +1466,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1346
1466
  return transporter.request(request, requestOptions);
1347
1467
  },
1348
1468
  /**
1349
- * Returns the most popular filter values for an attribute in the 1,000 most recently used filters.
1469
+ * Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting.
1350
1470
  *
1351
1471
  * Required API Key ACLs:
1352
1472
  * - analytics.
@@ -1354,12 +1474,12 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1354
1474
  * @param getTopFilterForAttribute - The getTopFilterForAttribute object.
1355
1475
  * @param getTopFilterForAttribute.attribute - Attribute name.
1356
1476
  * @param getTopFilterForAttribute.index - Index name.
1357
- * @param getTopFilterForAttribute.search - User query.
1477
+ * @param getTopFilterForAttribute.search - Search query.
1358
1478
  * @param getTopFilterForAttribute.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1359
1479
  * @param getTopFilterForAttribute.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1360
1480
  * @param getTopFilterForAttribute.limit - Number of items to return.
1361
1481
  * @param getTopFilterForAttribute.offset - Position of the first item to return.
1362
- * @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.
1482
+ * @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/).
1363
1483
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1364
1484
  */
1365
1485
  getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1402,19 +1522,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1402
1522
  return transporter.request(request, requestOptions);
1403
1523
  },
1404
1524
  /**
1405
- * Returns top filters for filter-enabled searches that don\'t return results. Limited to the 1,000 most recently used filters.
1525
+ * 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.
1406
1526
  *
1407
1527
  * Required API Key ACLs:
1408
1528
  * - analytics.
1409
1529
  *
1410
1530
  * @param getTopFiltersNoResults - The getTopFiltersNoResults object.
1411
1531
  * @param getTopFiltersNoResults.index - Index name.
1412
- * @param getTopFiltersNoResults.search - User query.
1532
+ * @param getTopFiltersNoResults.search - Search query.
1413
1533
  * @param getTopFiltersNoResults.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1414
1534
  * @param getTopFiltersNoResults.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1415
1535
  * @param getTopFiltersNoResults.limit - Number of items to return.
1416
1536
  * @param getTopFiltersNoResults.offset - Position of the first item to return.
1417
- * @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.
1537
+ * @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/).
1418
1538
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1419
1539
  */
1420
1540
  getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -1454,23 +1574,24 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1454
1574
  return transporter.request(request, requestOptions);
1455
1575
  },
1456
1576
  /**
1457
- * Return the most popular clicked results in the last 1,000 searches.
1577
+ * Retrieves the object IDs of the most frequent search results.
1458
1578
  *
1459
1579
  * Required API Key ACLs:
1460
1580
  * - analytics.
1461
1581
  *
1462
1582
  * @param getTopHits - The getTopHits object.
1463
1583
  * @param getTopHits.index - Index name.
1464
- * @param getTopHits.search - User query.
1465
- * @param getTopHits.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
1584
+ * @param getTopHits.search - Search query.
1585
+ * @param getTopHits.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
1586
+ * @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.
1466
1587
  * @param getTopHits.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1467
1588
  * @param getTopHits.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1468
1589
  * @param getTopHits.limit - Number of items to return.
1469
1590
  * @param getTopHits.offset - Position of the first item to return.
1470
- * @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.
1591
+ * @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/).
1471
1592
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1472
1593
  */
1473
- getTopHits({ index, search, clickAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
1594
+ getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
1474
1595
  if (!index) {
1475
1596
  throw new Error('Parameter `index` is required when calling `getTopHits`.');
1476
1597
  }
@@ -1486,6 +1607,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1486
1607
  if (clickAnalytics !== undefined) {
1487
1608
  queryParameters.clickAnalytics = clickAnalytics.toString();
1488
1609
  }
1610
+ if (revenueAnalytics !== undefined) {
1611
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
1612
+ }
1489
1613
  if (startDate !== undefined) {
1490
1614
  queryParameters.startDate = startDate.toString();
1491
1615
  }
@@ -1510,24 +1634,25 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1510
1634
  return transporter.request(request, requestOptions);
1511
1635
  },
1512
1636
  /**
1513
- * Returns the most popular of the latest 1,000 searches. For each search, also returns the number of hits.
1637
+ * Returns the most popular search terms.
1514
1638
  *
1515
1639
  * Required API Key ACLs:
1516
1640
  * - analytics.
1517
1641
  *
1518
1642
  * @param getTopSearches - The getTopSearches object.
1519
1643
  * @param getTopSearches.index - Index name.
1520
- * @param getTopSearches.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
1644
+ * @param getTopSearches.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
1645
+ * @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.
1521
1646
  * @param getTopSearches.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1522
1647
  * @param getTopSearches.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1523
- * @param getTopSearches.orderBy - Reorder the results.
1648
+ * @param getTopSearches.orderBy - Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.
1524
1649
  * @param getTopSearches.direction - Sorting direction of the results: ascending or descending.
1525
1650
  * @param getTopSearches.limit - Number of items to return.
1526
1651
  * @param getTopSearches.offset - Position of the first item to return.
1527
- * @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.
1652
+ * @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/).
1528
1653
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1529
1654
  */
1530
- getTopSearches({ index, clickAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
1655
+ getTopSearches({ index, clickAnalytics, revenueAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
1531
1656
  if (!index) {
1532
1657
  throw new Error('Parameter `index` is required when calling `getTopSearches`.');
1533
1658
  }
@@ -1540,6 +1665,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1540
1665
  if (clickAnalytics !== undefined) {
1541
1666
  queryParameters.clickAnalytics = clickAnalytics.toString();
1542
1667
  }
1668
+ if (revenueAnalytics !== undefined) {
1669
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
1670
+ }
1543
1671
  if (startDate !== undefined) {
1544
1672
  queryParameters.startDate = startDate.toString();
1545
1673
  }
@@ -1570,7 +1698,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1570
1698
  return transporter.request(request, requestOptions);
1571
1699
  },
1572
1700
  /**
1573
- * Return the count of unique users.
1701
+ * 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.
1574
1702
  *
1575
1703
  * Required API Key ACLs:
1576
1704
  * - analytics.
@@ -1579,7 +1707,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1579
1707
  * @param getUsersCount.index - Index name.
1580
1708
  * @param getUsersCount.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
1581
1709
  * @param getUsersCount.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
1582
- * @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.
1710
+ * @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/).
1583
1711
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1584
1712
  */
1585
1713
  getUsersCount({ index, startDate, endDate, tags }, requestOptions) {