@algolia/client-analytics 5.0.0-alpha.108 → 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 +6 -6
  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
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT
2
2
  import { createHttpRequester } from '@algolia/requester-node-http';
3
3
 
4
4
  // 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.
5
- const apiClientVersion = '5.0.0-alpha.108';
5
+ const apiClientVersion = '5.0.0-alpha.109';
6
6
  const REGIONS = ['de', 'us'];
7
7
  function getDefaultHosts(region) {
8
8
  const url = !region
@@ -73,7 +73,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
73
73
  if (!path) {
74
74
  throw new Error('Parameter `path` is required when calling `customDelete`.');
75
75
  }
76
- const requestPath = '/1{path}'.replace('{path}', path);
76
+ const requestPath = '/{path}'.replace('{path}', path);
77
77
  const headers = {};
78
78
  const queryParameters = parameters ? parameters : {};
79
79
  const request = {
@@ -96,7 +96,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
96
96
  if (!path) {
97
97
  throw new Error('Parameter `path` is required when calling `customGet`.');
98
98
  }
99
- const requestPath = '/1{path}'.replace('{path}', path);
99
+ const requestPath = '/{path}'.replace('{path}', path);
100
100
  const headers = {};
101
101
  const queryParameters = parameters ? parameters : {};
102
102
  const request = {
@@ -120,7 +120,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
120
120
  if (!path) {
121
121
  throw new Error('Parameter `path` is required when calling `customPost`.');
122
122
  }
123
- const requestPath = '/1{path}'.replace('{path}', path);
123
+ const requestPath = '/{path}'.replace('{path}', path);
124
124
  const headers = {};
125
125
  const queryParameters = parameters ? parameters : {};
126
126
  const request = {
@@ -145,7 +145,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
145
145
  if (!path) {
146
146
  throw new Error('Parameter `path` is required when calling `customPut`.');
147
147
  }
148
- const requestPath = '/1{path}'.replace('{path}', path);
148
+ const requestPath = '/{path}'.replace('{path}', path);
149
149
  const headers = {};
150
150
  const queryParameters = parameters ? parameters : {};
151
151
  const request = {
@@ -158,7 +158,47 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
158
158
  return transporter.request(request, requestOptions);
159
159
  },
160
160
  /**
161
- * 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`.
161
+ * 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.
162
+ *
163
+ * Required API Key ACLs:
164
+ * - analytics.
165
+ *
166
+ * @param getAddToCartRate - The getAddToCartRate object.
167
+ * @param getAddToCartRate.index - Index name.
168
+ * @param getAddToCartRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
169
+ * @param getAddToCartRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
170
+ * @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/).
171
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
172
+ */
173
+ getAddToCartRate({ index, startDate, endDate, tags }, requestOptions) {
174
+ if (!index) {
175
+ throw new Error('Parameter `index` is required when calling `getAddToCartRate`.');
176
+ }
177
+ const requestPath = '/2/conversions/addToCartRate';
178
+ const headers = {};
179
+ const queryParameters = {};
180
+ if (index !== undefined) {
181
+ queryParameters.index = index.toString();
182
+ }
183
+ if (startDate !== undefined) {
184
+ queryParameters.startDate = startDate.toString();
185
+ }
186
+ if (endDate !== undefined) {
187
+ queryParameters.endDate = endDate.toString();
188
+ }
189
+ if (tags !== undefined) {
190
+ queryParameters.tags = tags.toString();
191
+ }
192
+ const request = {
193
+ method: 'GET',
194
+ path: requestPath,
195
+ queryParameters,
196
+ headers,
197
+ };
198
+ return transporter.request(request, requestOptions);
199
+ },
200
+ /**
201
+ * 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.
162
202
  *
163
203
  * Required API Key ACLs:
164
204
  * - analytics.
@@ -167,7 +207,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
167
207
  * @param getAverageClickPosition.index - Index name.
168
208
  * @param getAverageClickPosition.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
169
209
  * @param getAverageClickPosition.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
170
- * @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.
210
+ * @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/).
171
211
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
172
212
  */
173
213
  getAverageClickPosition({ index, startDate, endDate, tags }, requestOptions) {
@@ -198,7 +238,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
198
238
  return transporter.request(request, requestOptions);
199
239
  },
200
240
  /**
201
- * 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`.
241
+ * 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.
202
242
  *
203
243
  * Required API Key ACLs:
204
244
  * - analytics.
@@ -207,7 +247,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
207
247
  * @param getClickPositions.index - Index name.
208
248
  * @param getClickPositions.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
209
249
  * @param getClickPositions.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
210
- * @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.
250
+ * @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/).
211
251
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
212
252
  */
213
253
  getClickPositions({ index, startDate, endDate, tags }, requestOptions) {
@@ -238,7 +278,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
238
278
  return transporter.request(request, requestOptions);
239
279
  },
240
280
  /**
241
- * Returns a [click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
281
+ * 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.
242
282
  *
243
283
  * Required API Key ACLs:
244
284
  * - analytics.
@@ -247,7 +287,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
247
287
  * @param getClickThroughRate.index - Index name.
248
288
  * @param getClickThroughRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
249
289
  * @param getClickThroughRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
250
- * @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.
290
+ * @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/).
251
291
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
252
292
  */
253
293
  getClickThroughRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -278,21 +318,21 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
278
318
  return transporter.request(request, requestOptions);
279
319
  },
280
320
  /**
281
- * Return a [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
321
+ * 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.
282
322
  *
283
323
  * Required API Key ACLs:
284
324
  * - analytics.
285
325
  *
286
- * @param getConversationRate - The getConversationRate object.
287
- * @param getConversationRate.index - Index name.
288
- * @param getConversationRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
289
- * @param getConversationRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
290
- * @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.
326
+ * @param getConversionRate - The getConversionRate object.
327
+ * @param getConversionRate.index - Index name.
328
+ * @param getConversionRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
329
+ * @param getConversionRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
330
+ * @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/).
291
331
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
292
332
  */
293
- getConversationRate({ index, startDate, endDate, tags }, requestOptions) {
333
+ getConversionRate({ index, startDate, endDate, tags }, requestOptions) {
294
334
  if (!index) {
295
- throw new Error('Parameter `index` is required when calling `getConversationRate`.');
335
+ throw new Error('Parameter `index` is required when calling `getConversionRate`.');
296
336
  }
297
337
  const requestPath = '/2/conversions/conversionRate';
298
338
  const headers = {};
@@ -318,7 +358,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
318
358
  return transporter.request(request, requestOptions);
319
359
  },
320
360
  /**
321
- * 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.
361
+ * 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.
322
362
  *
323
363
  * Required API Key ACLs:
324
364
  * - analytics.
@@ -327,7 +367,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
327
367
  * @param getNoClickRate.index - Index name.
328
368
  * @param getNoClickRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
329
369
  * @param getNoClickRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
330
- * @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.
370
+ * @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/).
331
371
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
332
372
  */
333
373
  getNoClickRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -358,7 +398,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
358
398
  return transporter.request(request, requestOptions);
359
399
  },
360
400
  /**
361
- * Returns the rate at which searches didn\'t return any results.
401
+ * 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.
362
402
  *
363
403
  * Required API Key ACLs:
364
404
  * - analytics.
@@ -367,7 +407,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
367
407
  * @param getNoResultsRate.index - Index name.
368
408
  * @param getNoResultsRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
369
409
  * @param getNoResultsRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
370
- * @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.
410
+ * @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/).
371
411
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
372
412
  */
373
413
  getNoResultsRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -398,7 +438,87 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
398
438
  return transporter.request(request, requestOptions);
399
439
  },
400
440
  /**
401
- * Returns the number of searches within a time range.
441
+ * 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.
442
+ *
443
+ * Required API Key ACLs:
444
+ * - analytics.
445
+ *
446
+ * @param getPurchaseRate - The getPurchaseRate object.
447
+ * @param getPurchaseRate.index - Index name.
448
+ * @param getPurchaseRate.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
449
+ * @param getPurchaseRate.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
450
+ * @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/).
451
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
452
+ */
453
+ getPurchaseRate({ index, startDate, endDate, tags }, requestOptions) {
454
+ if (!index) {
455
+ throw new Error('Parameter `index` is required when calling `getPurchaseRate`.');
456
+ }
457
+ const requestPath = '/2/conversions/purchaseRate';
458
+ const headers = {};
459
+ const queryParameters = {};
460
+ if (index !== undefined) {
461
+ queryParameters.index = index.toString();
462
+ }
463
+ if (startDate !== undefined) {
464
+ queryParameters.startDate = startDate.toString();
465
+ }
466
+ if (endDate !== undefined) {
467
+ queryParameters.endDate = endDate.toString();
468
+ }
469
+ if (tags !== undefined) {
470
+ queryParameters.tags = tags.toString();
471
+ }
472
+ const request = {
473
+ method: 'GET',
474
+ path: requestPath,
475
+ queryParameters,
476
+ headers,
477
+ };
478
+ return transporter.request(request, requestOptions);
479
+ },
480
+ /**
481
+ * 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.
482
+ *
483
+ * Required API Key ACLs:
484
+ * - analytics.
485
+ *
486
+ * @param getRevenue - The getRevenue object.
487
+ * @param getRevenue.index - Index name.
488
+ * @param getRevenue.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
489
+ * @param getRevenue.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
490
+ * @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/).
491
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
492
+ */
493
+ getRevenue({ index, startDate, endDate, tags }, requestOptions) {
494
+ if (!index) {
495
+ throw new Error('Parameter `index` is required when calling `getRevenue`.');
496
+ }
497
+ const requestPath = '/2/conversions/revenue';
498
+ const headers = {};
499
+ const queryParameters = {};
500
+ if (index !== undefined) {
501
+ queryParameters.index = index.toString();
502
+ }
503
+ if (startDate !== undefined) {
504
+ queryParameters.startDate = startDate.toString();
505
+ }
506
+ if (endDate !== undefined) {
507
+ queryParameters.endDate = endDate.toString();
508
+ }
509
+ if (tags !== undefined) {
510
+ queryParameters.tags = tags.toString();
511
+ }
512
+ const request = {
513
+ method: 'GET',
514
+ path: requestPath,
515
+ queryParameters,
516
+ headers,
517
+ };
518
+ return transporter.request(request, requestOptions);
519
+ },
520
+ /**
521
+ * 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.
402
522
  *
403
523
  * Required API Key ACLs:
404
524
  * - analytics.
@@ -407,7 +527,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
407
527
  * @param getSearchesCount.index - Index name.
408
528
  * @param getSearchesCount.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
409
529
  * @param getSearchesCount.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
410
- * @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.
530
+ * @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/).
411
531
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
412
532
  */
413
533
  getSearchesCount({ index, startDate, endDate, tags }, requestOptions) {
@@ -438,7 +558,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
438
558
  return transporter.request(request, requestOptions);
439
559
  },
440
560
  /**
441
- * Return the most popular of the last 1,000 searches that didn\'t lead to any clicks.
561
+ * Retrieves the most popular searches that didn\'t lead to any clicks, from the 1,000 most frequent searches.
442
562
  *
443
563
  * Required API Key ACLs:
444
564
  * - analytics.
@@ -449,7 +569,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
449
569
  * @param getSearchesNoClicks.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
450
570
  * @param getSearchesNoClicks.limit - Number of items to return.
451
571
  * @param getSearchesNoClicks.offset - Position of the first item to return.
452
- * @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.
572
+ * @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/).
453
573
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
454
574
  */
455
575
  getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -486,7 +606,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
486
606
  return transporter.request(request, requestOptions);
487
607
  },
488
608
  /**
489
- * Returns the most popular of the latest 1,000 searches that didn\'t return any results.
609
+ * Retrieves the most popular searches that didn\'t return any results.
490
610
  *
491
611
  * Required API Key ACLs:
492
612
  * - analytics.
@@ -497,7 +617,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
497
617
  * @param getSearchesNoResults.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
498
618
  * @param getSearchesNoResults.limit - Number of items to return.
499
619
  * @param getSearchesNoResults.offset - Position of the first item to return.
500
- * @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.
620
+ * @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/).
501
621
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
502
622
  */
503
623
  getSearchesNoResults({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -534,7 +654,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
534
654
  return transporter.request(request, requestOptions);
535
655
  },
536
656
  /**
537
- * 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.
657
+ * Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.
538
658
  *
539
659
  * Required API Key ACLs:
540
660
  * - analytics.
@@ -562,7 +682,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
562
682
  return transporter.request(request, requestOptions);
563
683
  },
564
684
  /**
565
- * Returns top countries. Limited to the 1,000 most frequent ones.
685
+ * Retrieves the countries with the most searches to your index.
566
686
  *
567
687
  * Required API Key ACLs:
568
688
  * - analytics.
@@ -573,7 +693,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
573
693
  * @param getTopCountries.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
574
694
  * @param getTopCountries.limit - Number of items to return.
575
695
  * @param getTopCountries.offset - Position of the first item to return.
576
- * @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.
696
+ * @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/).
577
697
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
578
698
  */
579
699
  getTopCountries({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
@@ -610,19 +730,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
610
730
  return transporter.request(request, requestOptions);
611
731
  },
612
732
  /**
613
- * 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.
733
+ * Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting.
614
734
  *
615
735
  * Required API Key ACLs:
616
736
  * - analytics.
617
737
  *
618
738
  * @param getTopFilterAttributes - The getTopFilterAttributes object.
619
739
  * @param getTopFilterAttributes.index - Index name.
620
- * @param getTopFilterAttributes.search - User query.
740
+ * @param getTopFilterAttributes.search - Search query.
621
741
  * @param getTopFilterAttributes.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
622
742
  * @param getTopFilterAttributes.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
623
743
  * @param getTopFilterAttributes.limit - Number of items to return.
624
744
  * @param getTopFilterAttributes.offset - Position of the first item to return.
625
- * @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.
745
+ * @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/).
626
746
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
627
747
  */
628
748
  getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -662,7 +782,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
662
782
  return transporter.request(request, requestOptions);
663
783
  },
664
784
  /**
665
- * Returns the most popular filter values for an attribute in the 1,000 most recently used filters.
785
+ * Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting.
666
786
  *
667
787
  * Required API Key ACLs:
668
788
  * - analytics.
@@ -670,12 +790,12 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
670
790
  * @param getTopFilterForAttribute - The getTopFilterForAttribute object.
671
791
  * @param getTopFilterForAttribute.attribute - Attribute name.
672
792
  * @param getTopFilterForAttribute.index - Index name.
673
- * @param getTopFilterForAttribute.search - User query.
793
+ * @param getTopFilterForAttribute.search - Search query.
674
794
  * @param getTopFilterForAttribute.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
675
795
  * @param getTopFilterForAttribute.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
676
796
  * @param getTopFilterForAttribute.limit - Number of items to return.
677
797
  * @param getTopFilterForAttribute.offset - Position of the first item to return.
678
- * @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.
798
+ * @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/).
679
799
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
680
800
  */
681
801
  getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -718,19 +838,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
718
838
  return transporter.request(request, requestOptions);
719
839
  },
720
840
  /**
721
- * Returns top filters for filter-enabled searches that don\'t return results. Limited to the 1,000 most recently used filters.
841
+ * 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.
722
842
  *
723
843
  * Required API Key ACLs:
724
844
  * - analytics.
725
845
  *
726
846
  * @param getTopFiltersNoResults - The getTopFiltersNoResults object.
727
847
  * @param getTopFiltersNoResults.index - Index name.
728
- * @param getTopFiltersNoResults.search - User query.
848
+ * @param getTopFiltersNoResults.search - Search query.
729
849
  * @param getTopFiltersNoResults.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
730
850
  * @param getTopFiltersNoResults.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
731
851
  * @param getTopFiltersNoResults.limit - Number of items to return.
732
852
  * @param getTopFiltersNoResults.offset - Position of the first item to return.
733
- * @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.
853
+ * @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/).
734
854
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
735
855
  */
736
856
  getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -770,23 +890,24 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
770
890
  return transporter.request(request, requestOptions);
771
891
  },
772
892
  /**
773
- * Return the most popular clicked results in the last 1,000 searches.
893
+ * Retrieves the object IDs of the most frequent search results.
774
894
  *
775
895
  * Required API Key ACLs:
776
896
  * - analytics.
777
897
  *
778
898
  * @param getTopHits - The getTopHits object.
779
899
  * @param getTopHits.index - Index name.
780
- * @param getTopHits.search - User query.
781
- * @param getTopHits.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
900
+ * @param getTopHits.search - Search query.
901
+ * @param getTopHits.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
902
+ * @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.
782
903
  * @param getTopHits.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
783
904
  * @param getTopHits.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
784
905
  * @param getTopHits.limit - Number of items to return.
785
906
  * @param getTopHits.offset - Position of the first item to return.
786
- * @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.
907
+ * @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/).
787
908
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
788
909
  */
789
- getTopHits({ index, search, clickAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
910
+ getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
790
911
  if (!index) {
791
912
  throw new Error('Parameter `index` is required when calling `getTopHits`.');
792
913
  }
@@ -802,6 +923,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
802
923
  if (clickAnalytics !== undefined) {
803
924
  queryParameters.clickAnalytics = clickAnalytics.toString();
804
925
  }
926
+ if (revenueAnalytics !== undefined) {
927
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
928
+ }
805
929
  if (startDate !== undefined) {
806
930
  queryParameters.startDate = startDate.toString();
807
931
  }
@@ -826,24 +950,25 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
826
950
  return transporter.request(request, requestOptions);
827
951
  },
828
952
  /**
829
- * Returns the most popular of the latest 1,000 searches. For each search, also returns the number of hits.
953
+ * Returns the most popular search terms.
830
954
  *
831
955
  * Required API Key ACLs:
832
956
  * - analytics.
833
957
  *
834
958
  * @param getTopSearches - The getTopSearches object.
835
959
  * @param getTopSearches.index - Index name.
836
- * @param getTopSearches.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
960
+ * @param getTopSearches.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
961
+ * @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.
837
962
  * @param getTopSearches.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
838
963
  * @param getTopSearches.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
839
- * @param getTopSearches.orderBy - Reorder the results.
964
+ * @param getTopSearches.orderBy - Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.
840
965
  * @param getTopSearches.direction - Sorting direction of the results: ascending or descending.
841
966
  * @param getTopSearches.limit - Number of items to return.
842
967
  * @param getTopSearches.offset - Position of the first item to return.
843
- * @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.
968
+ * @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/).
844
969
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
845
970
  */
846
- getTopSearches({ index, clickAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
971
+ getTopSearches({ index, clickAnalytics, revenueAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
847
972
  if (!index) {
848
973
  throw new Error('Parameter `index` is required when calling `getTopSearches`.');
849
974
  }
@@ -856,6 +981,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
856
981
  if (clickAnalytics !== undefined) {
857
982
  queryParameters.clickAnalytics = clickAnalytics.toString();
858
983
  }
984
+ if (revenueAnalytics !== undefined) {
985
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
986
+ }
859
987
  if (startDate !== undefined) {
860
988
  queryParameters.startDate = startDate.toString();
861
989
  }
@@ -886,7 +1014,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
886
1014
  return transporter.request(request, requestOptions);
887
1015
  },
888
1016
  /**
889
- * Return the count of unique users.
1017
+ * 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.
890
1018
  *
891
1019
  * Required API Key ACLs:
892
1020
  * - analytics.
@@ -895,7 +1023,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
895
1023
  * @param getUsersCount.index - Index name.
896
1024
  * @param getUsersCount.startDate - Start date (`YYYY-MM-DD`) of the period to analyze.
897
1025
  * @param getUsersCount.endDate - End date (`YYYY-MM-DD`) of the period to analyze.
898
- * @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.
1026
+ * @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/).
899
1027
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
900
1028
  */
901
1029
  getUsersCount({ index, startDate, endDate, tags }, requestOptions) {