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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/dist/builds/browser.d.ts +37 -3
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +37 -3
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/client-analytics.cjs +314 -153
  6. package/dist/client-analytics.esm.browser.js +300 -144
  7. package/dist/client-analytics.esm.node.js +314 -153
  8. package/dist/client-analytics.umd.js +2 -2
  9. package/dist/model/clickPositionsInner.d.ts +14 -0
  10. package/dist/model/clickPositionsInner.d.ts.map +1 -0
  11. package/dist/model/clientMethodProps.d.ts +161 -90
  12. package/dist/model/clientMethodProps.d.ts.map +1 -1
  13. package/dist/model/currenciesValue.d.ts +14 -0
  14. package/dist/model/currenciesValue.d.ts.map +1 -0
  15. package/dist/model/dailyAddToCartRates.d.ts +19 -0
  16. package/dist/model/dailyAddToCartRates.d.ts.map +1 -0
  17. package/dist/model/dailyAverageClicks.d.ts +15 -0
  18. package/dist/model/dailyAverageClicks.d.ts.map +1 -0
  19. package/dist/model/dailyClickThroughRates.d.ts +19 -0
  20. package/dist/model/dailyClickThroughRates.d.ts.map +1 -0
  21. package/dist/model/dailyConversionRates.d.ts +19 -0
  22. package/dist/model/dailyConversionRates.d.ts.map +1 -0
  23. package/dist/model/dailyNoClickRates.d.ts +19 -0
  24. package/dist/model/dailyNoClickRates.d.ts.map +1 -0
  25. package/dist/model/dailyNoResultsRates.d.ts +19 -0
  26. package/dist/model/dailyNoResultsRates.d.ts.map +1 -0
  27. package/dist/model/dailyPurchaseRates.d.ts +19 -0
  28. package/dist/model/dailyPurchaseRates.d.ts.map +1 -0
  29. package/dist/model/dailyRevenue.d.ts +12 -0
  30. package/dist/model/dailyRevenue.d.ts.map +1 -0
  31. package/dist/model/dailySearches.d.ts +11 -0
  32. package/dist/model/dailySearches.d.ts.map +1 -0
  33. package/dist/model/dailySearchesNoClicks.d.ts +15 -0
  34. package/dist/model/dailySearchesNoClicks.d.ts.map +1 -0
  35. package/dist/model/dailySearchesNoResults.d.ts +15 -0
  36. package/dist/model/dailySearchesNoResults.d.ts.map +1 -0
  37. package/dist/model/dailyUsers.d.ts +11 -0
  38. package/dist/model/dailyUsers.d.ts.map +1 -0
  39. package/dist/model/getAddToCartRateResponse.d.ts +20 -0
  40. package/dist/model/getAddToCartRateResponse.d.ts.map +1 -0
  41. package/dist/model/getAverageClickPositionResponse.d.ts +6 -6
  42. package/dist/model/getAverageClickPositionResponse.d.ts.map +1 -1
  43. package/dist/model/getClickPositionsResponse.d.ts +3 -3
  44. package/dist/model/getClickPositionsResponse.d.ts.map +1 -1
  45. package/dist/model/getClickThroughRateResponse.d.ts +7 -7
  46. package/dist/model/getClickThroughRateResponse.d.ts.map +1 -1
  47. package/dist/model/getConversionRateResponse.d.ts +20 -0
  48. package/dist/model/getConversionRateResponse.d.ts.map +1 -0
  49. package/dist/model/getNoClickRateResponse.d.ts +6 -6
  50. package/dist/model/getNoClickRateResponse.d.ts.map +1 -1
  51. package/dist/model/getNoResultsRateResponse.d.ts +6 -6
  52. package/dist/model/getNoResultsRateResponse.d.ts.map +1 -1
  53. package/dist/model/getPurchaseRateResponse.d.ts +20 -0
  54. package/dist/model/getPurchaseRateResponse.d.ts.map +1 -0
  55. package/dist/model/getRevenue.d.ts +13 -0
  56. package/dist/model/getRevenue.d.ts.map +1 -0
  57. package/dist/model/getSearchesCountResponse.d.ts +3 -3
  58. package/dist/model/getSearchesCountResponse.d.ts.map +1 -1
  59. package/dist/model/getSearchesNoClicksResponse.d.ts +3 -3
  60. package/dist/model/getSearchesNoClicksResponse.d.ts.map +1 -1
  61. package/dist/model/getSearchesNoResultsResponse.d.ts +3 -3
  62. package/dist/model/getSearchesNoResultsResponse.d.ts.map +1 -1
  63. package/dist/model/getStatusResponse.d.ts +2 -2
  64. package/dist/model/getStatusResponse.d.ts.map +1 -1
  65. package/dist/model/getTopCountriesResponse.d.ts +1 -1
  66. package/dist/model/getTopFilterAttributesResponse.d.ts +1 -1
  67. package/dist/model/getTopFilterForAttribute.d.ts +2 -4
  68. package/dist/model/getTopFilterForAttribute.d.ts.map +1 -1
  69. package/dist/model/getTopFiltersNoResultsResponse.d.ts +2 -2
  70. package/dist/model/getTopFiltersNoResultsResponse.d.ts.map +1 -1
  71. package/dist/model/getTopFiltersNoResultsValue.d.ts +2 -4
  72. package/dist/model/getTopFiltersNoResultsValue.d.ts.map +1 -1
  73. package/dist/model/getTopHitsResponse.d.ts +2 -1
  74. package/dist/model/getTopHitsResponse.d.ts.map +1 -1
  75. package/dist/model/getTopSearchesResponse.d.ts +2 -1
  76. package/dist/model/getTopSearchesResponse.d.ts.map +1 -1
  77. package/dist/model/getUsersCountResponse.d.ts +4 -4
  78. package/dist/model/getUsersCountResponse.d.ts.map +1 -1
  79. package/dist/model/index.d.ts +23 -11
  80. package/dist/model/index.d.ts.map +1 -1
  81. package/dist/model/operator.d.ts +5 -0
  82. package/dist/model/operator.d.ts.map +1 -0
  83. package/dist/model/orderBy.d.ts +1 -1
  84. package/dist/model/topCountry.d.ts +1 -1
  85. package/dist/model/topHit.d.ts +1 -1
  86. package/dist/model/topHitWithAnalytics.d.ts +9 -9
  87. package/dist/model/topHitWithAnalytics.d.ts.map +1 -1
  88. package/dist/model/topHitWithRevenueAnalytics.d.ts +52 -0
  89. package/dist/model/topHitWithRevenueAnalytics.d.ts.map +1 -0
  90. package/dist/model/topHitsResponse.d.ts +1 -1
  91. package/dist/model/topHitsResponseWithAnalytics.d.ts +1 -1
  92. package/dist/model/topHitsResponseWithRevenueAnalytics.d.ts +8 -0
  93. package/dist/model/topHitsResponseWithRevenueAnalytics.d.ts.map +1 -0
  94. package/dist/model/topSearch.d.ts +3 -3
  95. package/dist/model/topSearchWithAnalytics.d.ts +17 -12
  96. package/dist/model/topSearchWithAnalytics.d.ts.map +1 -1
  97. package/dist/model/topSearchWithRevenueAnalytics.d.ts +65 -0
  98. package/dist/model/topSearchWithRevenueAnalytics.d.ts.map +1 -0
  99. package/dist/model/topSearchesResponse.d.ts +1 -1
  100. package/dist/model/topSearchesResponseWithAnalytics.d.ts +1 -1
  101. package/dist/model/topSearchesResponseWithRevenueAnalytics.d.ts +8 -0
  102. package/dist/model/topSearchesResponseWithRevenueAnalytics.d.ts.map +1 -0
  103. package/dist/src/analyticsClient.d.ts +211 -138
  104. package/dist/src/analyticsClient.d.ts.map +1 -1
  105. package/model/clickPositionsInner.ts +16 -0
  106. package/model/clientMethodProps.ts +164 -90
  107. package/model/currenciesValue.ts +16 -0
  108. package/model/dailyAddToCartRates.ts +23 -0
  109. package/model/dailyAverageClicks.ts +18 -0
  110. package/model/dailyClickThroughRates.ts +23 -0
  111. package/model/dailyConversionRates.ts +23 -0
  112. package/model/dailyNoClickRates.ts +23 -0
  113. package/model/dailyNoResultsRates.ts +23 -0
  114. package/model/dailyPurchaseRates.ts +23 -0
  115. package/model/dailyRevenue.ts +15 -0
  116. package/model/{searchEvent.ts → dailySearches.ts} +2 -2
  117. package/model/{searchNoResultEvent.ts → dailySearchesNoClicks.ts} +4 -4
  118. package/model/{searchNoClickEvent.ts → dailySearchesNoResults.ts} +3 -3
  119. package/model/{userWithDate.ts → dailyUsers.ts} +3 -3
  120. package/model/getAddToCartRateResponse.ts +25 -0
  121. package/model/getAverageClickPositionResponse.ts +6 -6
  122. package/model/getClickPositionsResponse.ts +3 -3
  123. package/model/getClickThroughRateResponse.ts +7 -7
  124. package/model/getConversionRateResponse.ts +25 -0
  125. package/model/getNoClickRateResponse.ts +6 -6
  126. package/model/getNoResultsRateResponse.ts +6 -6
  127. package/model/getPurchaseRateResponse.ts +25 -0
  128. package/model/getRevenue.ts +16 -0
  129. package/model/getSearchesCountResponse.ts +3 -3
  130. package/model/getSearchesNoClicksResponse.ts +3 -3
  131. package/model/getSearchesNoResultsResponse.ts +3 -3
  132. package/model/getStatusResponse.ts +2 -2
  133. package/model/getTopCountriesResponse.ts +1 -1
  134. package/model/getTopFilterAttributesResponse.ts +1 -1
  135. package/model/getTopFilterForAttribute.ts +3 -4
  136. package/model/getTopFiltersNoResultsResponse.ts +2 -2
  137. package/model/getTopFiltersNoResultsValue.ts +3 -4
  138. package/model/getTopHitsResponse.ts +5 -1
  139. package/model/getTopSearchesResponse.ts +3 -1
  140. package/model/getUsersCountResponse.ts +4 -4
  141. package/model/index.ts +23 -11
  142. package/model/operator.ts +6 -0
  143. package/model/orderBy.ts +1 -1
  144. package/model/topCountry.ts +1 -1
  145. package/model/topHit.ts +1 -1
  146. package/model/topHitWithAnalytics.ts +9 -9
  147. package/model/topHitWithRevenueAnalytics.ts +65 -0
  148. package/model/topHitsResponse.ts +1 -1
  149. package/model/topHitsResponseWithAnalytics.ts +1 -1
  150. package/model/topHitsResponseWithRevenueAnalytics.ts +10 -0
  151. package/model/topSearch.ts +3 -3
  152. package/model/topSearchWithAnalytics.ts +19 -12
  153. package/model/topSearchWithRevenueAnalytics.ts +81 -0
  154. package/model/topSearchesResponse.ts +1 -1
  155. package/model/topSearchesResponseWithAnalytics.ts +1 -1
  156. package/model/topSearchesResponseWithRevenueAnalytics.ts +10 -0
  157. package/package.json +7 -7
  158. package/dist/model/averageClickEvent.d.ts +0 -15
  159. package/dist/model/averageClickEvent.d.ts.map +0 -1
  160. package/dist/model/clickPosition.d.ts +0 -11
  161. package/dist/model/clickPosition.d.ts.map +0 -1
  162. package/dist/model/clickThroughRateEvent.d.ts +0 -19
  163. package/dist/model/clickThroughRateEvent.d.ts.map +0 -1
  164. package/dist/model/conversionRateEvent.d.ts +0 -19
  165. package/dist/model/conversionRateEvent.d.ts.map +0 -1
  166. package/dist/model/getConversationRateResponse.d.ts +0 -20
  167. package/dist/model/getConversationRateResponse.d.ts.map +0 -1
  168. package/dist/model/noClickRateEvent.d.ts +0 -19
  169. package/dist/model/noClickRateEvent.d.ts.map +0 -1
  170. package/dist/model/noResultsRateEvent.d.ts +0 -19
  171. package/dist/model/noResultsRateEvent.d.ts.map +0 -1
  172. package/dist/model/searchEvent.d.ts +0 -11
  173. package/dist/model/searchEvent.d.ts.map +0 -1
  174. package/dist/model/searchNoClickEvent.d.ts +0 -15
  175. package/dist/model/searchNoClickEvent.d.ts.map +0 -1
  176. package/dist/model/searchNoResultEvent.d.ts +0 -15
  177. package/dist/model/searchNoResultEvent.d.ts.map +0 -1
  178. package/dist/model/userWithDate.d.ts +0 -11
  179. package/dist/model/userWithDate.d.ts.map +0 -1
  180. package/model/averageClickEvent.ts +0 -18
  181. package/model/clickPosition.ts +0 -13
  182. package/model/clickThroughRateEvent.ts +0 -23
  183. package/model/conversionRateEvent.ts +0 -23
  184. package/model/getConversationRateResponse.ts +0 -25
  185. package/model/noClickRateEvent.ts +0 -23
  186. package/model/noResultsRateEvent.ts +0 -23
@@ -4,7 +4,7 @@ var clientCommon = require('@algolia/client-common');
4
4
  var requesterNodeHttp = require('@algolia/requester-node-http');
5
5
 
6
6
  // 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.
7
- const apiClientVersion = '5.0.0-alpha.98';
7
+ const apiClientVersion = '5.0.0-beta.1';
8
8
  const REGIONS = ['de', 'us'];
9
9
  function getDefaultHosts(region) {
10
10
  const url = !region
@@ -66,7 +66,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
66
66
  /**
67
67
  * This method allow you to send requests to the Algolia REST API.
68
68
  *
69
- * @summary Send requests to the Algolia REST API.
70
69
  * @param customDelete - The customDelete object.
71
70
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
72
71
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -76,7 +75,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
76
75
  if (!path) {
77
76
  throw new Error('Parameter `path` is required when calling `customDelete`.');
78
77
  }
79
- const requestPath = '/1{path}'.replace('{path}', path);
78
+ const requestPath = '/{path}'.replace('{path}', path);
80
79
  const headers = {};
81
80
  const queryParameters = parameters ? parameters : {};
82
81
  const request = {
@@ -90,7 +89,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
90
89
  /**
91
90
  * This method allow you to send requests to the Algolia REST API.
92
91
  *
93
- * @summary Send requests to the Algolia REST API.
94
92
  * @param customGet - The customGet object.
95
93
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
96
94
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -100,7 +98,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
100
98
  if (!path) {
101
99
  throw new Error('Parameter `path` is required when calling `customGet`.');
102
100
  }
103
- const requestPath = '/1{path}'.replace('{path}', path);
101
+ const requestPath = '/{path}'.replace('{path}', path);
104
102
  const headers = {};
105
103
  const queryParameters = parameters ? parameters : {};
106
104
  const request = {
@@ -114,7 +112,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
114
112
  /**
115
113
  * This method allow you to send requests to the Algolia REST API.
116
114
  *
117
- * @summary Send requests to the Algolia REST API.
118
115
  * @param customPost - The customPost object.
119
116
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
120
117
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -125,7 +122,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
125
122
  if (!path) {
126
123
  throw new Error('Parameter `path` is required when calling `customPost`.');
127
124
  }
128
- const requestPath = '/1{path}'.replace('{path}', path);
125
+ const requestPath = '/{path}'.replace('{path}', path);
129
126
  const headers = {};
130
127
  const queryParameters = parameters ? parameters : {};
131
128
  const request = {
@@ -140,7 +137,6 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
140
137
  /**
141
138
  * This method allow you to send requests to the Algolia REST API.
142
139
  *
143
- * @summary Send requests to the Algolia REST API.
144
140
  * @param customPut - The customPut object.
145
141
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
146
142
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -151,7 +147,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
151
147
  if (!path) {
152
148
  throw new Error('Parameter `path` is required when calling `customPut`.');
153
149
  }
154
- const requestPath = '/1{path}'.replace('{path}', path);
150
+ const requestPath = '/{path}'.replace('{path}', path);
155
151
  const headers = {};
156
152
  const queryParameters = parameters ? parameters : {};
157
153
  const request = {
@@ -164,14 +160,56 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
164
160
  return transporter.request(request, requestOptions);
165
161
  },
166
162
  /**
167
- * 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`.
163
+ * 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.
164
+ *
165
+ * Required API Key ACLs:
166
+ * - analytics.
167
+ *
168
+ * @param getAddToCartRate - The getAddToCartRate object.
169
+ * @param getAddToCartRate.index - Index name.
170
+ * @param getAddToCartRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
171
+ * @param getAddToCartRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
172
+ * @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/).
173
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
174
+ */
175
+ getAddToCartRate({ index, startDate, endDate, tags }, requestOptions) {
176
+ if (!index) {
177
+ throw new Error('Parameter `index` is required when calling `getAddToCartRate`.');
178
+ }
179
+ const requestPath = '/2/conversions/addToCartRate';
180
+ const headers = {};
181
+ const queryParameters = {};
182
+ if (index !== undefined) {
183
+ queryParameters.index = index.toString();
184
+ }
185
+ if (startDate !== undefined) {
186
+ queryParameters.startDate = startDate.toString();
187
+ }
188
+ if (endDate !== undefined) {
189
+ queryParameters.endDate = endDate.toString();
190
+ }
191
+ if (tags !== undefined) {
192
+ queryParameters.tags = tags.toString();
193
+ }
194
+ const request = {
195
+ method: 'GET',
196
+ path: requestPath,
197
+ queryParameters,
198
+ headers,
199
+ };
200
+ return transporter.request(request, requestOptions);
201
+ },
202
+ /**
203
+ * 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.
204
+ *
205
+ * Required API Key ACLs:
206
+ * - analytics.
168
207
  *
169
- * @summary Get average click position.
170
208
  * @param getAverageClickPosition - The getAverageClickPosition object.
171
- * @param getAverageClickPosition.index - Index name to target.
172
- * @param getAverageClickPosition.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
173
- * @param getAverageClickPosition.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
174
- * @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.
209
+ * @param getAverageClickPosition.index - Index name.
210
+ * @param getAverageClickPosition.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
211
+ * @param getAverageClickPosition.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
212
+ * @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/).
175
213
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
176
214
  */
177
215
  getAverageClickPosition({ index, startDate, endDate, tags }, requestOptions) {
@@ -202,14 +240,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
202
240
  return transporter.request(request, requestOptions);
203
241
  },
204
242
  /**
205
- * 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`.
243
+ * 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.
244
+ *
245
+ * Required API Key ACLs:
246
+ * - analytics.
206
247
  *
207
- * @summary Get click positions.
208
248
  * @param getClickPositions - The getClickPositions object.
209
- * @param getClickPositions.index - Index name to target.
210
- * @param getClickPositions.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
211
- * @param getClickPositions.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
212
- * @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.
249
+ * @param getClickPositions.index - Index name.
250
+ * @param getClickPositions.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
251
+ * @param getClickPositions.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
252
+ * @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/).
213
253
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
214
254
  */
215
255
  getClickPositions({ index, startDate, endDate, tags }, requestOptions) {
@@ -240,14 +280,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
240
280
  return transporter.request(request, requestOptions);
241
281
  },
242
282
  /**
243
- * Returns a [click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate).
283
+ * 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.
284
+ *
285
+ * Required API Key ACLs:
286
+ * - analytics.
244
287
  *
245
- * @summary Get click-through rate (CTR).
246
288
  * @param getClickThroughRate - The getClickThroughRate object.
247
- * @param getClickThroughRate.index - Index name to target.
248
- * @param getClickThroughRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
249
- * @param getClickThroughRate.endDate - End date (a string in the format `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.
289
+ * @param getClickThroughRate.index - Index name.
290
+ * @param getClickThroughRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
291
+ * @param getClickThroughRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
292
+ * @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
293
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
252
294
  */
253
295
  getClickThroughRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -278,19 +320,21 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
278
320
  return transporter.request(request, requestOptions);
279
321
  },
280
322
  /**
281
- * Return a [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate).
282
- *
283
- * @summary Get conversion rate (CR).
284
- * @param getConversationRate - The getConversationRate object.
285
- * @param getConversationRate.index - Index name to target.
286
- * @param getConversationRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
287
- * @param getConversationRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
288
- * @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.
323
+ * 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.
324
+ *
325
+ * Required API Key ACLs:
326
+ * - analytics.
327
+ *
328
+ * @param getConversionRate - The getConversionRate object.
329
+ * @param getConversionRate.index - Index name.
330
+ * @param getConversionRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
331
+ * @param getConversionRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
332
+ * @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/).
289
333
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
290
334
  */
291
- getConversationRate({ index, startDate, endDate, tags }, requestOptions) {
335
+ getConversionRate({ index, startDate, endDate, tags }, requestOptions) {
292
336
  if (!index) {
293
- throw new Error('Parameter `index` is required when calling `getConversationRate`.');
337
+ throw new Error('Parameter `index` is required when calling `getConversionRate`.');
294
338
  }
295
339
  const requestPath = '/2/conversions/conversionRate';
296
340
  const headers = {};
@@ -316,14 +360,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
316
360
  return transporter.request(request, requestOptions);
317
361
  },
318
362
  /**
319
- * 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.
363
+ * 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.
364
+ *
365
+ * Required API Key ACLs:
366
+ * - analytics.
320
367
  *
321
- * @summary Get no click rate.
322
368
  * @param getNoClickRate - The getNoClickRate object.
323
- * @param getNoClickRate.index - Index name to target.
324
- * @param getNoClickRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
325
- * @param getNoClickRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
326
- * @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.
369
+ * @param getNoClickRate.index - Index name.
370
+ * @param getNoClickRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
371
+ * @param getNoClickRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
372
+ * @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/).
327
373
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
328
374
  */
329
375
  getNoClickRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -354,14 +400,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
354
400
  return transporter.request(request, requestOptions);
355
401
  },
356
402
  /**
357
- * Returns the rate at which searches didn\'t return any results.
403
+ * 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.
404
+ *
405
+ * Required API Key ACLs:
406
+ * - analytics.
358
407
  *
359
- * @summary Get no results rate.
360
408
  * @param getNoResultsRate - The getNoResultsRate object.
361
- * @param getNoResultsRate.index - Index name to target.
362
- * @param getNoResultsRate.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
363
- * @param getNoResultsRate.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
364
- * @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.
409
+ * @param getNoResultsRate.index - Index name.
410
+ * @param getNoResultsRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
411
+ * @param getNoResultsRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
412
+ * @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/).
365
413
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
366
414
  */
367
415
  getNoResultsRate({ index, startDate, endDate, tags }, requestOptions) {
@@ -392,14 +440,96 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
392
440
  return transporter.request(request, requestOptions);
393
441
  },
394
442
  /**
395
- * Returns the number of searches within a time range.
443
+ * 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.
444
+ *
445
+ * Required API Key ACLs:
446
+ * - analytics.
447
+ *
448
+ * @param getPurchaseRate - The getPurchaseRate object.
449
+ * @param getPurchaseRate.index - Index name.
450
+ * @param getPurchaseRate.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
451
+ * @param getPurchaseRate.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
452
+ * @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/).
453
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
454
+ */
455
+ getPurchaseRate({ index, startDate, endDate, tags }, requestOptions) {
456
+ if (!index) {
457
+ throw new Error('Parameter `index` is required when calling `getPurchaseRate`.');
458
+ }
459
+ const requestPath = '/2/conversions/purchaseRate';
460
+ const headers = {};
461
+ const queryParameters = {};
462
+ if (index !== undefined) {
463
+ queryParameters.index = index.toString();
464
+ }
465
+ if (startDate !== undefined) {
466
+ queryParameters.startDate = startDate.toString();
467
+ }
468
+ if (endDate !== undefined) {
469
+ queryParameters.endDate = endDate.toString();
470
+ }
471
+ if (tags !== undefined) {
472
+ queryParameters.tags = tags.toString();
473
+ }
474
+ const request = {
475
+ method: 'GET',
476
+ path: requestPath,
477
+ queryParameters,
478
+ headers,
479
+ };
480
+ return transporter.request(request, requestOptions);
481
+ },
482
+ /**
483
+ * 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.
484
+ *
485
+ * Required API Key ACLs:
486
+ * - analytics.
487
+ *
488
+ * @param getRevenue - The getRevenue object.
489
+ * @param getRevenue.index - Index name.
490
+ * @param getRevenue.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
491
+ * @param getRevenue.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
492
+ * @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/).
493
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
494
+ */
495
+ getRevenue({ index, startDate, endDate, tags }, requestOptions) {
496
+ if (!index) {
497
+ throw new Error('Parameter `index` is required when calling `getRevenue`.');
498
+ }
499
+ const requestPath = '/2/conversions/revenue';
500
+ const headers = {};
501
+ const queryParameters = {};
502
+ if (index !== undefined) {
503
+ queryParameters.index = index.toString();
504
+ }
505
+ if (startDate !== undefined) {
506
+ queryParameters.startDate = startDate.toString();
507
+ }
508
+ if (endDate !== undefined) {
509
+ queryParameters.endDate = endDate.toString();
510
+ }
511
+ if (tags !== undefined) {
512
+ queryParameters.tags = tags.toString();
513
+ }
514
+ const request = {
515
+ method: 'GET',
516
+ path: requestPath,
517
+ queryParameters,
518
+ headers,
519
+ };
520
+ return transporter.request(request, requestOptions);
521
+ },
522
+ /**
523
+ * 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.
524
+ *
525
+ * Required API Key ACLs:
526
+ * - analytics.
396
527
  *
397
- * @summary Get number of searches.
398
528
  * @param getSearchesCount - The getSearchesCount object.
399
- * @param getSearchesCount.index - Index name to target.
400
- * @param getSearchesCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
401
- * @param getSearchesCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
402
- * @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.
529
+ * @param getSearchesCount.index - Index name.
530
+ * @param getSearchesCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
531
+ * @param getSearchesCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
532
+ * @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/).
403
533
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
404
534
  */
405
535
  getSearchesCount({ index, startDate, endDate, tags }, requestOptions) {
@@ -430,16 +560,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
430
560
  return transporter.request(request, requestOptions);
431
561
  },
432
562
  /**
433
- * Return the most popular of the last 1,000 searches that didn\'t lead to any clicks.
563
+ * Retrieves the most popular searches that didn\'t lead to any clicks, from the 1,000 most frequent searches.
564
+ *
565
+ * Required API Key ACLs:
566
+ * - analytics.
434
567
  *
435
- * @summary Get top searches with no clicks.
436
568
  * @param getSearchesNoClicks - The getSearchesNoClicks object.
437
- * @param getSearchesNoClicks.index - Index name to target.
438
- * @param getSearchesNoClicks.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
439
- * @param getSearchesNoClicks.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
440
- * @param getSearchesNoClicks.limit - Number of records to return (page size).
441
- * @param getSearchesNoClicks.offset - Position of the starting record. Used for paging. 0 is the first record.
442
- * @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.
569
+ * @param getSearchesNoClicks.index - Index name.
570
+ * @param getSearchesNoClicks.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
571
+ * @param getSearchesNoClicks.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
572
+ * @param getSearchesNoClicks.limit - Number of items to return.
573
+ * @param getSearchesNoClicks.offset - Position of the first item to return.
574
+ * @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/).
443
575
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
444
576
  */
445
577
  getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -476,16 +608,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
476
608
  return transporter.request(request, requestOptions);
477
609
  },
478
610
  /**
479
- * Returns the most popular of the latest 1,000 searches that didn\'t return any results.
611
+ * Retrieves the most popular searches that didn\'t return any results.
612
+ *
613
+ * Required API Key ACLs:
614
+ * - analytics.
480
615
  *
481
- * @summary Get top searches with no results.
482
616
  * @param getSearchesNoResults - The getSearchesNoResults object.
483
- * @param getSearchesNoResults.index - Index name to target.
484
- * @param getSearchesNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
485
- * @param getSearchesNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
486
- * @param getSearchesNoResults.limit - Number of records to return (page size).
487
- * @param getSearchesNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
488
- * @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.
617
+ * @param getSearchesNoResults.index - Index name.
618
+ * @param getSearchesNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
619
+ * @param getSearchesNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
620
+ * @param getSearchesNoResults.limit - Number of items to return.
621
+ * @param getSearchesNoResults.offset - Position of the first item to return.
622
+ * @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/).
489
623
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
490
624
  */
491
625
  getSearchesNoResults({ index, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -522,11 +656,13 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
522
656
  return transporter.request(request, requestOptions);
523
657
  },
524
658
  /**
525
- * 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.
659
+ * Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.
660
+ *
661
+ * Required API Key ACLs:
662
+ * - analytics.
526
663
  *
527
- * @summary Get Analytics API status.
528
664
  * @param getStatus - The getStatus object.
529
- * @param getStatus.index - Index name to target.
665
+ * @param getStatus.index - Index name.
530
666
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
531
667
  */
532
668
  getStatus({ index }, requestOptions) {
@@ -548,16 +684,18 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
548
684
  return transporter.request(request, requestOptions);
549
685
  },
550
686
  /**
551
- * Returns top countries. Limited to the 1,000 most frequent ones.
687
+ * Retrieves the countries with the most searches to your index.
688
+ *
689
+ * Required API Key ACLs:
690
+ * - analytics.
552
691
  *
553
- * @summary Get top countries.
554
692
  * @param getTopCountries - The getTopCountries object.
555
- * @param getTopCountries.index - Index name to target.
556
- * @param getTopCountries.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
557
- * @param getTopCountries.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
558
- * @param getTopCountries.limit - Number of records to return (page size).
559
- * @param getTopCountries.offset - Position of the starting record. Used for paging. 0 is the first record.
560
- * @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.
693
+ * @param getTopCountries.index - Index name.
694
+ * @param getTopCountries.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
695
+ * @param getTopCountries.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
696
+ * @param getTopCountries.limit - Number of items to return.
697
+ * @param getTopCountries.offset - Position of the first item to return.
698
+ * @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/).
561
699
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
562
700
  */
563
701
  getTopCountries({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
@@ -594,17 +732,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
594
732
  return transporter.request(request, requestOptions);
595
733
  },
596
734
  /**
597
- * 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.
735
+ * Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting.
736
+ *
737
+ * Required API Key ACLs:
738
+ * - analytics.
598
739
  *
599
- * @summary Get top filterable attributes.
600
740
  * @param getTopFilterAttributes - The getTopFilterAttributes object.
601
- * @param getTopFilterAttributes.index - Index name to target.
602
- * @param getTopFilterAttributes.search - User query.
603
- * @param getTopFilterAttributes.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
604
- * @param getTopFilterAttributes.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
605
- * @param getTopFilterAttributes.limit - Number of records to return (page size).
606
- * @param getTopFilterAttributes.offset - Position of the starting record. Used for paging. 0 is the first record.
607
- * @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.
741
+ * @param getTopFilterAttributes.index - Index name.
742
+ * @param getTopFilterAttributes.search - Search query.
743
+ * @param getTopFilterAttributes.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
744
+ * @param getTopFilterAttributes.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
745
+ * @param getTopFilterAttributes.limit - Number of items to return.
746
+ * @param getTopFilterAttributes.offset - Position of the first item to return.
747
+ * @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/).
608
748
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
609
749
  */
610
750
  getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -644,18 +784,20 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
644
784
  return transporter.request(request, requestOptions);
645
785
  },
646
786
  /**
647
- * Returns the most popular filter values for an attribute in the 1,000 most recently used filters.
787
+ * Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting.
788
+ *
789
+ * Required API Key ACLs:
790
+ * - analytics.
648
791
  *
649
- * @summary Get top filter values for an attribute.
650
792
  * @param getTopFilterForAttribute - The getTopFilterForAttribute object.
651
793
  * @param getTopFilterForAttribute.attribute - Attribute name.
652
- * @param getTopFilterForAttribute.index - Index name to target.
653
- * @param getTopFilterForAttribute.search - User query.
654
- * @param getTopFilterForAttribute.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
655
- * @param getTopFilterForAttribute.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
656
- * @param getTopFilterForAttribute.limit - Number of records to return (page size).
657
- * @param getTopFilterForAttribute.offset - Position of the starting record. Used for paging. 0 is the first record.
658
- * @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.
794
+ * @param getTopFilterForAttribute.index - Index name.
795
+ * @param getTopFilterForAttribute.search - Search query.
796
+ * @param getTopFilterForAttribute.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
797
+ * @param getTopFilterForAttribute.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
798
+ * @param getTopFilterForAttribute.limit - Number of items to return.
799
+ * @param getTopFilterForAttribute.offset - Position of the first item to return.
800
+ * @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/).
659
801
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
660
802
  */
661
803
  getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -698,17 +840,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
698
840
  return transporter.request(request, requestOptions);
699
841
  },
700
842
  /**
701
- * Returns top filters for filter-enabled searches that don\'t return results. Limited to the 1,000 most recently used filters.
843
+ * 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.
844
+ *
845
+ * Required API Key ACLs:
846
+ * - analytics.
702
847
  *
703
- * @summary Get top filters for a no result search.
704
848
  * @param getTopFiltersNoResults - The getTopFiltersNoResults object.
705
- * @param getTopFiltersNoResults.index - Index name to target.
706
- * @param getTopFiltersNoResults.search - User query.
707
- * @param getTopFiltersNoResults.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
708
- * @param getTopFiltersNoResults.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
709
- * @param getTopFiltersNoResults.limit - Number of records to return (page size).
710
- * @param getTopFiltersNoResults.offset - Position of the starting record. Used for paging. 0 is the first record.
711
- * @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.
849
+ * @param getTopFiltersNoResults.index - Index name.
850
+ * @param getTopFiltersNoResults.search - Search query.
851
+ * @param getTopFiltersNoResults.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
852
+ * @param getTopFiltersNoResults.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
853
+ * @param getTopFiltersNoResults.limit - Number of items to return.
854
+ * @param getTopFiltersNoResults.offset - Position of the first item to return.
855
+ * @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/).
712
856
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
713
857
  */
714
858
  getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags, }, requestOptions) {
@@ -748,21 +892,24 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
748
892
  return transporter.request(request, requestOptions);
749
893
  },
750
894
  /**
751
- * Return the most popular clicked results in the last 1,000 searches.
895
+ * Retrieves the object IDs of the most frequent search results.
896
+ *
897
+ * Required API Key ACLs:
898
+ * - analytics.
752
899
  *
753
- * @summary Get top hits.
754
900
  * @param getTopHits - The getTopHits object.
755
- * @param getTopHits.index - Index name to target.
756
- * @param getTopHits.search - User query.
757
- * @param getTopHits.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
758
- * @param getTopHits.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
759
- * @param getTopHits.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
760
- * @param getTopHits.limit - Number of records to return (page size).
761
- * @param getTopHits.offset - Position of the starting record. Used for paging. 0 is the first record.
762
- * @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.
901
+ * @param getTopHits.index - Index name.
902
+ * @param getTopHits.search - Search query.
903
+ * @param getTopHits.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
904
+ * @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.
905
+ * @param getTopHits.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
906
+ * @param getTopHits.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
907
+ * @param getTopHits.limit - Number of items to return.
908
+ * @param getTopHits.offset - Position of the first item to return.
909
+ * @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/).
763
910
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
764
911
  */
765
- getTopHits({ index, search, clickAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
912
+ getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags, }, requestOptions) {
766
913
  if (!index) {
767
914
  throw new Error('Parameter `index` is required when calling `getTopHits`.');
768
915
  }
@@ -778,6 +925,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
778
925
  if (clickAnalytics !== undefined) {
779
926
  queryParameters.clickAnalytics = clickAnalytics.toString();
780
927
  }
928
+ if (revenueAnalytics !== undefined) {
929
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
930
+ }
781
931
  if (startDate !== undefined) {
782
932
  queryParameters.startDate = startDate.toString();
783
933
  }
@@ -802,22 +952,25 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
802
952
  return transporter.request(request, requestOptions);
803
953
  },
804
954
  /**
805
- * Returns the most popular of the latest 1,000 searches. For each search, also returns the number of hits.
955
+ * Returns the most popular search terms.
956
+ *
957
+ * Required API Key ACLs:
958
+ * - analytics.
806
959
  *
807
- * @summary Get top searches.
808
960
  * @param getTopSearches - The getTopSearches object.
809
- * @param getTopSearches.index - Index name to target.
810
- * @param getTopSearches.clickAnalytics - Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search.
811
- * @param getTopSearches.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
812
- * @param getTopSearches.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
813
- * @param getTopSearches.orderBy - Reorder the results.
961
+ * @param getTopSearches.index - Index name.
962
+ * @param getTopSearches.clickAnalytics - Whether to include metrics related to click and conversion events in the response.
963
+ * @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.
964
+ * @param getTopSearches.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
965
+ * @param getTopSearches.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
966
+ * @param getTopSearches.orderBy - Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available.
814
967
  * @param getTopSearches.direction - Sorting direction of the results: ascending or descending.
815
- * @param getTopSearches.limit - Number of records to return (page size).
816
- * @param getTopSearches.offset - Position of the starting record. Used for paging. 0 is the first record.
817
- * @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.limit - Number of items to return.
969
+ * @param getTopSearches.offset - Position of the first item to return.
970
+ * @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/).
818
971
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
819
972
  */
820
- getTopSearches({ index, clickAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
973
+ getTopSearches({ index, clickAnalytics, revenueAnalytics, startDate, endDate, orderBy, direction, limit, offset, tags, }, requestOptions) {
821
974
  if (!index) {
822
975
  throw new Error('Parameter `index` is required when calling `getTopSearches`.');
823
976
  }
@@ -830,6 +983,9 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
830
983
  if (clickAnalytics !== undefined) {
831
984
  queryParameters.clickAnalytics = clickAnalytics.toString();
832
985
  }
986
+ if (revenueAnalytics !== undefined) {
987
+ queryParameters.revenueAnalytics = revenueAnalytics.toString();
988
+ }
833
989
  if (startDate !== undefined) {
834
990
  queryParameters.startDate = startDate.toString();
835
991
  }
@@ -860,14 +1016,16 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
860
1016
  return transporter.request(request, requestOptions);
861
1017
  },
862
1018
  /**
863
- * Return the count of unique users.
1019
+ * 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.
1020
+ *
1021
+ * Required API Key ACLs:
1022
+ * - analytics.
864
1023
  *
865
- * @summary Get user count.
866
1024
  * @param getUsersCount - The getUsersCount object.
867
- * @param getUsersCount.index - Index name to target.
868
- * @param getUsersCount.startDate - Start date (a string in the format `YYYY-MM-DD`) of the period to analyze.
869
- * @param getUsersCount.endDate - End date (a string in the format `YYYY-MM-DD`) of the period to analyze.
870
- * @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.
1025
+ * @param getUsersCount.index - Index name.
1026
+ * @param getUsersCount.startDate - Start date of the period to analyze, in `YYYY-MM-DD` format.
1027
+ * @param getUsersCount.endDate - End date of the period to analyze, in `YYYY-MM-DD` format.
1028
+ * @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/).
871
1029
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
872
1030
  */
873
1031
  getUsersCount({ index, startDate, endDate, tags }, requestOptions) {
@@ -901,6 +1059,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
901
1059
  }
902
1060
 
903
1061
  // 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.
1062
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
904
1063
  function analyticsClient(appId, apiKey, region, options) {
905
1064
  if (!appId || typeof appId !== 'string') {
906
1065
  throw new Error('`appId` is missing.');
@@ -911,22 +1070,24 @@ function analyticsClient(appId, apiKey, region, options) {
911
1070
  if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {
912
1071
  throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
913
1072
  }
914
- return createAnalyticsClient({
915
- appId,
916
- apiKey,
917
- region,
918
- timeouts: {
919
- connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
920
- read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
921
- write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
922
- },
923
- requester: requesterNodeHttp.createHttpRequester(),
924
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
925
- responsesCache: clientCommon.createNullCache(),
926
- requestsCache: clientCommon.createNullCache(),
927
- hostsCache: clientCommon.createMemoryCache(),
928
- ...options,
929
- });
1073
+ return {
1074
+ ...createAnalyticsClient({
1075
+ appId,
1076
+ apiKey,
1077
+ region,
1078
+ timeouts: {
1079
+ connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
1080
+ read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
1081
+ write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
1082
+ },
1083
+ requester: requesterNodeHttp.createHttpRequester(),
1084
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
1085
+ responsesCache: clientCommon.createNullCache(),
1086
+ requestsCache: clientCommon.createNullCache(),
1087
+ hostsCache: clientCommon.createMemoryCache(),
1088
+ ...options,
1089
+ }),
1090
+ };
930
1091
  }
931
1092
 
932
1093
  exports.analyticsClient = analyticsClient;