diff --git a/specs/analytics/common/parameters.yml b/specs/analytics/common/parameters.yml index 3b39b4b78c..856801d404 100644 --- a/specs/analytics/common/parameters.yml +++ b/specs/analytics/common/parameters.yml @@ -76,10 +76,7 @@ ClickAnalytics: RevenueAnalytics: in: query name: revenueAnalytics - description: | - Whether to include revenue-related metrics in the response. - - If true, metrics related to click and conversion events are also included in the response. + description: Whether to include metrics related to revenue events in the response. schema: type: boolean default: false @@ -184,7 +181,7 @@ clickThroughRate: type: number format: double description: | - Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. + Click-through rate: calculated as the number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true. nullable: true minimum: 0 @@ -195,7 +192,8 @@ clickThroughRate: noClickRate: type: number format: double - description: No click rate, calculated as number of tracked searches without any click divided by the number of tracked searches. + description: | + No click rate: calculated as the number of tracked searches without clicks divided by the number of tracked searches. minimum: 0 maximum: 1 example: 0.15 @@ -203,7 +201,8 @@ noClickRate: noResultsRate: type: number format: double - description: No results rate, calculated as number of searches with zero results divided by the total number of searches. + description: | + No results rate: calculated as the number of searches with zero results divided by the total number of searches. minimum: 0 maximum: 1 example: 0.49 @@ -212,7 +211,7 @@ conversionRate: type: number format: double description: | - Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. + Conversion rate: calculated as the number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true. nullable: true minimum: 0 @@ -231,7 +230,7 @@ addToCartRate: type: number format: double description: | - Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the number of tracked searches. + Add-to-cart rate: calculated as the number of tracked searches with at least one add-to-cart event divided by the number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true. nullable: true minimum: 0 @@ -250,7 +249,7 @@ purchaseRate: type: number format: double description: | - Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number of tracked searches. + Purchase rate: calculated as the number of tracked searches with at least one purchase event divided by the number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true. nullable: true minimum: 0 @@ -266,7 +265,8 @@ purchaseCount: currencies: type: object - description: Revenue associated with this search, broken-down by currencies. + description: | + Revenue associated with this search: broken down by currency. default: {} additionalProperties: title: currencyCode @@ -310,7 +310,7 @@ search: type: string hit: - description: Object ID of a record that's returned as a search result. + description: Object ID of a record returned as a search result. type: string example: 'method-export-rules-php' diff --git a/specs/analytics/common/schemas/getTopFiltersNoResults.yml b/specs/analytics/common/schemas/getTopFiltersNoResults.yml index 19dd41b7f5..a3c0bee919 100644 --- a/specs/analytics/common/schemas/getTopFiltersNoResults.yml +++ b/specs/analytics/common/schemas/getTopFiltersNoResults.yml @@ -9,7 +9,7 @@ getTopFiltersNoResultsResponse: nullable: true description: | Filters for searches without any results. - If null, the search term specified with the `search` parameter is not a search without results, + If null, the search term specified with the `search` parameter isn't a search without results, or the `search` parameter is absent from the request. items: $ref: '#/getTopFiltersNoResultsValues' diff --git a/specs/analytics/paths/click/getAddToCartRate.yml b/specs/analytics/paths/click/getAddToCartRate.yml index 483b3e4831..47fef56388 100644 --- a/specs/analytics/paths/click/getAddToCartRate.yml +++ b/specs/analytics/paths/click/getAddToCartRate.yml @@ -6,9 +6,18 @@ get: - analytics summary: Retrieve add-to-cart rate description: | - Retrieves the add-to-cart rate for all of your searches with at least one add-to-cart event, including a daily breakdown. + Retrieves the add-to-cart rate for all 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. + + The rate is the number of add-to-cart conversion events divided by the number of tracked searches. + A search is tracked if it returns a queryID (`clickAnalytics` is `true`). + This differs from the response's `count`, which shows the overall number of searches, including those where `clickAnalytics` is `false`. + + **There's a difference between a 0 and null add-to-cart rate when `clickAnalytics` is enabled:** + + - **Null** means there were no queries: since Algolia didn't receive any events, the add-to-cart rate is null. + - **0** mean there _were_ queries but no [add-to-cart events](https://www.algolia.com/doc/guides/sending-events/getting-started/) were received. parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../../common/parameters.yml#/StartDate' diff --git a/specs/analytics/paths/click/getAverageClickPosition.yml b/specs/analytics/paths/click/getAverageClickPosition.yml index 5949bcc68e..bd3cf3c512 100644 --- a/specs/analytics/paths/click/getAverageClickPosition.yml +++ b/specs/analytics/paths/click/getAverageClickPosition.yml @@ -8,9 +8,12 @@ get: description: | 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. + The average click position is the average of all clicked search result 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. + + An average of `null` when `clickAnalytics` is enabled means Algolia didn't receive any [click events](https://www.algolia.com/doc/guides/sending-events/getting-started/) for the queries. + The average is `null` until Algolia receives at least one click event. parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../../common/parameters.yml#/StartDate' diff --git a/specs/analytics/paths/click/getClickPositions.yml b/specs/analytics/paths/click/getClickPositions.yml index e5cc9a741b..a4a4eab00f 100644 --- a/specs/analytics/paths/click/getClickPositions.yml +++ b/specs/analytics/paths/click/getClickPositions.yml @@ -9,6 +9,8 @@ get: 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. + + An average of `0` when `clickAnalytics` is enabled means Algolia didn't receive any [click events](https://www.algolia.com/doc/guides/sending-events/getting-started/) for the queries. parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../../common/parameters.yml#/StartDate' diff --git a/specs/analytics/paths/click/getClickThroughRate.yml b/specs/analytics/paths/click/getClickThroughRate.yml index 07ee4ce35e..9de85ef411 100644 --- a/specs/analytics/paths/click/getClickThroughRate.yml +++ b/specs/analytics/paths/click/getClickThroughRate.yml @@ -6,9 +6,14 @@ get: - analytics summary: Retrieve click-through rate description: | - Retrieves the click-through rate for all of your searches with at least one click event, including a daily breakdown + Retrieves the click-through rate (CTR) for all 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. + + **There's a difference between a 0 and null CTR when `clickAnalytics` is enabled:** + + - **Null** means there were no queries: since Algolia didn't receive any events, CTR is null. + - **0** mean there _were_ queries but no [click events](https://www.algolia.com/doc/guides/sending-events/getting-started/) were received. parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../../common/parameters.yml#/StartDate' diff --git a/specs/analytics/paths/click/getConversionRate.yml b/specs/analytics/paths/click/getConversionRate.yml index bc269f3f50..29f3d0c420 100644 --- a/specs/analytics/paths/click/getConversionRate.yml +++ b/specs/analytics/paths/click/getConversionRate.yml @@ -6,9 +6,14 @@ get: - analytics summary: Retrieve conversion rate description: | - Retrieves the conversion rate for all of your searches with at least one conversion event, including a daily breakdown. + Retrieves the conversion rate (CR) for all 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. + + **There's a difference between a 0 and null CR when `clickAnalytics` is enabled:** + + - **Null** means there were no queries: since Algolia didn't receive any events, CR is null. + - **0** mean there _were_ queries but no [conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started/) were received. parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../../common/parameters.yml#/StartDate' diff --git a/specs/analytics/paths/click/getPurchaseRate.yml b/specs/analytics/paths/click/getPurchaseRate.yml index b1fd6a5324..4e3971b95a 100644 --- a/specs/analytics/paths/click/getPurchaseRate.yml +++ b/specs/analytics/paths/click/getPurchaseRate.yml @@ -6,9 +6,18 @@ get: - analytics summary: Retrieve purchase rate description: | - Retrieves the purchase rate for all of your searches with at least one purchase event, including a daily breakdown. + Retrieves the purchase rate for all 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. + + The rate is the number of purchase conversion events divided by the number of tracked searches. + A search is tracked if it returns a query ID (`clickAnalytics` is `true`). + This differs from the response's `count`, which shows the overall number of searches, including those where `clickAnalytics` is `false`. + + **There's a difference between a 0 and null purchase rate when `clickAnalytics` is enabled:** + + - **Null** means there were no queries: since Algolia didn't receive any events, the purchase rate is null. + - **0** mean there _were_ queries but no [purchase conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started/) were received. parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../../common/parameters.yml#/StartDate' diff --git a/specs/analytics/paths/revenue/getRevenue.yml b/specs/analytics/paths/revenue/getRevenue.yml index 29f1326a2c..1fa6a1f4dd 100644 --- a/specs/analytics/paths/revenue/getRevenue.yml +++ b/specs/analytics/paths/revenue/getRevenue.yml @@ -1,6 +1,6 @@ get: tags: - - click + - revenue operationId: getRevenue x-acl: - analytics @@ -8,8 +8,11 @@ get: description: | Retrieves revenue-related metrics, such as the total revenue or the average order value. - To retrieve revenue-related metrics, sent purchase events. + To retrieve revenue-related metrics, send purchase events. By default, the analyzed period includes the last eight days including the current day. + + Revenue is based on purchase conversion events (a conversion event with an `eventSubtype` attribute of `purchase`). + The revenue is the `price` attribute multiplied by the `quantity` attribute for each object in the event's `objectData` array. parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../../common/parameters.yml#/StartDate' diff --git a/specs/analytics/paths/search/getNoClickRate.yml b/specs/analytics/paths/search/getNoClickRate.yml index 3658e28ac3..875011f476 100644 --- a/specs/analytics/paths/search/getNoClickRate.yml +++ b/specs/analytics/paths/search/getNoClickRate.yml @@ -7,6 +7,7 @@ get: summary: Retrieve no click rate description: | Retrieves the fraction of searches that didn't lead to any click within a time range, including a daily breakdown. + It also returns the number of tracked searches and tracked searches without clicks. By default, the analyzed period includes the last eight days including the current day. parameters: diff --git a/specs/analytics/paths/search/getNoResultsRate.yml b/specs/analytics/paths/search/getNoResultsRate.yml index 6308781c9a..e1bce775bb 100644 --- a/specs/analytics/paths/search/getNoResultsRate.yml +++ b/specs/analytics/paths/search/getNoResultsRate.yml @@ -7,6 +7,7 @@ get: summary: Retrieve no results rate description: | Retrieves the fraction of searches that didn't return any results within a time range, including a daily breakdown. + It also returns the count of searches and searches without results used to compute the rates. By default, the analyzed period includes the last eight days including the current day. parameters: diff --git a/specs/analytics/paths/search/getSearchesNoClicks.yml b/specs/analytics/paths/search/getSearchesNoClicks.yml index a70eb88ad0..7728f93ceb 100644 --- a/specs/analytics/paths/search/getSearchesNoClicks.yml +++ b/specs/analytics/paths/search/getSearchesNoClicks.yml @@ -5,7 +5,10 @@ get: x-acl: - analytics summary: Retrieve top searches without clicks - description: Retrieves the most popular searches that didn't lead to any clicks, from the 1,000 most frequent searches. + description: | + Retrieves the most popular searches that didn't lead to any clicks, from the 1,000 most frequent searches. + + For each search, it also returns the number of displayed search results that remained unclicked. parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../../common/parameters.yml#/StartDate' diff --git a/specs/analytics/paths/search/getSearchesNoResults.yml b/specs/analytics/paths/search/getSearchesNoResults.yml index dae7f00374..4c007ce239 100644 --- a/specs/analytics/paths/search/getSearchesNoResults.yml +++ b/specs/analytics/paths/search/getSearchesNoResults.yml @@ -4,8 +4,9 @@ get: operationId: getSearchesNoResults x-acl: - analytics - summary: Retrieve top searches without results - description: Retrieves the most popular searches that didn't return any results. + summary: Retrieve the most frequent searches without results. + description: Retrieves the 1,000 most frequent searches that produced zero results. + parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../../common/parameters.yml#/StartDate' diff --git a/specs/analytics/paths/search/getTopCountries.yml b/specs/analytics/paths/search/getTopCountries.yml index f9c2ecd35d..787f152ed5 100644 --- a/specs/analytics/paths/search/getTopCountries.yml +++ b/specs/analytics/paths/search/getTopCountries.yml @@ -5,7 +5,7 @@ get: x-acl: - analytics summary: Retrieve top countries - description: Retrieves the countries with the most searches to your index. + description: Retrieves the countries with the most searches in your index. parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../../common/parameters.yml#/StartDate' diff --git a/specs/analytics/paths/search/getTopFilterAttributes.yml b/specs/analytics/paths/search/getTopFilterAttributes.yml index 09fef5b892..e49b1431a0 100644 --- a/specs/analytics/paths/search/getTopFilterAttributes.yml +++ b/specs/analytics/paths/search/getTopFilterAttributes.yml @@ -6,7 +6,7 @@ get: - analytics summary: Retrieve top filters description: | - Retrieves the most frequently used filter attributes. + Retrieves the 1,000 most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting. parameters: diff --git a/specs/analytics/paths/search/getTopFilterForAttribute.yml b/specs/analytics/paths/search/getTopFilterForAttribute.yml index e88dee1897..4890ab7f8a 100644 --- a/specs/analytics/paths/search/getTopFilterForAttribute.yml +++ b/specs/analytics/paths/search/getTopFilterForAttribute.yml @@ -6,7 +6,7 @@ get: - analytics summary: Retrieve top filter values description: | - Retrieves the most frequent filter (facet) values for a filter attribute. + Retrieves the 1,000 most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting. parameters: diff --git a/specs/analytics/paths/search/getTopFiltersNoResults.yml b/specs/analytics/paths/search/getTopFiltersNoResults.yml index e6e91c65a2..4f1477f20a 100644 --- a/specs/analytics/paths/search/getTopFiltersNoResults.yml +++ b/specs/analytics/paths/search/getTopFiltersNoResults.yml @@ -6,7 +6,7 @@ get: - analytics summary: Retrieve top filters for a search without results description: | - Retrieves the most frequently used filters for a search that didn't return any results. + Retrieves the 1,000 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. parameters: diff --git a/specs/analytics/paths/search/getTopHits.yml b/specs/analytics/paths/search/getTopHits.yml index 1e420ba0a2..eac581cca9 100644 --- a/specs/analytics/paths/search/getTopHits.yml +++ b/specs/analytics/paths/search/getTopHits.yml @@ -5,7 +5,30 @@ get: x-acl: - analytics summary: Retrieve top search results - description: Retrieves the object IDs of the most frequent search results. + description: | + Retrieves the object IDs of the 1,000 most frequent search results. + + If you set the `clickAnalytics` query parameter to true, the response also includes: + + - Tracked searches count. Tracked searches are Search API requests with the `clickAnalytics` parameter set to `true`. This differs from the response's `count`, which shows the overall number of searches, including those where `clickAnalytics` is `false`. + - Click count + - Click-through rate (CTR) + - Conversion count + - Conversion rate (CR) + - Average click position + + If you set the `revenueAnalytics` parameter to `true`, the response also includes: + + - Add-to-cart count + - Add-to-cart rate (ATCR) + - Purchase count + - Purchase rate + - Revenue details for each currency + + **There's a difference between 0% rates and null rates:** + + - **Null** means there were no queries: since Algolia didn't receive any events, the rates (CTR, CR, ATCR, purchase rate) are null. + - **0% rates** mean there _were_ queries but no [click or conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started/) were received. parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../common/parameters.yml#/Search' diff --git a/specs/analytics/paths/search/getTopSearches.yml b/specs/analytics/paths/search/getTopSearches.yml index 90d44dc744..a18070c236 100644 --- a/specs/analytics/paths/search/getTopSearches.yml +++ b/specs/analytics/paths/search/getTopSearches.yml @@ -5,7 +5,30 @@ get: x-acl: - analytics summary: Retrieve top searches - description: Returns the most popular search terms. + description: | + Returns the most popular searches. For each search, it also includes the average number of hits. + + If you set the `clickAnalytics` query parameter to `true`, the response also includes + + - Tracked searches count. Tracked searches are Search API requests with the `clickAnalytics` parameter set to `true`. This differs from the response's `count`, which shows the overall number of searches, including those where `clickAnalytics` is `false`. + - Click count + - Click-through rate (CTR) + - Conversion count + - Conversion rate (CR) + - Average click position + + If you set the `revenueAnalytics` query parameter to `true`, the response also includes: + + - Add-to-cart count + - Add-to-cart rate (ATCR) + - Purchase count + - Purchase rate + - Revenue details for each currency + + **There's a difference between 0% rates and null rates:** + + - **Null** means there were no queries: since Algolia didn't receive any events, the rates (CTR, CR, ATCR, purchase rate) are null. + - **0% rates** mean there _were_ queries but no [click or conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started/) were received. parameters: - $ref: '../../../common/parameters.yml#/Index' - $ref: '../../common/parameters.yml#/ClickAnalytics' diff --git a/specs/analytics/paths/search/getUsersCount.yml b/specs/analytics/paths/search/getUsersCount.yml index 857a7e1efa..6b72d96d64 100644 --- a/specs/analytics/paths/search/getUsersCount.yml +++ b/specs/analytics/paths/search/getUsersCount.yml @@ -8,10 +8,12 @@ get: description: | 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. + Since it 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. + 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. + - The analyzed period includes the last eight days including the current day. externalDocs: url: https://www.algolia.com/doc/guides/search-analytics/guides/usertoken/ description: | diff --git a/specs/analytics/paths/status/getStatus.yml b/specs/analytics/paths/status/getStatus.yml index ad89391e93..2031d44ebd 100644 --- a/specs/analytics/paths/status/getStatus.yml +++ b/specs/analytics/paths/status/getStatus.yml @@ -8,7 +8,9 @@ get: description: | Retrieves the time when the Analytics data for the specified index was last updated. - The Analytics data is updated every 5 minutes. + If the index has been recently created or no search has been performed yet the updated time is `null`. + + The Analytics data is updated every 5 minutes. parameters: - $ref: '../../../common/parameters.yml#/Index' responses: diff --git a/specs/analytics/spec.yml b/specs/analytics/spec.yml index 104379dde3..bc1de2d80d 100644 --- a/specs/analytics/spec.yml +++ b/specs/analytics/spec.yml @@ -48,13 +48,25 @@ info: The Analytics API returns JSON responses. Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API response. - Successful responses return a `2xx` status. Client errors return a `4xx` status. Server errors are indicated by a `5xx` status. + - Successful responses return a `2xx` status + - Client errors return a `4xx` status + - Server errors are indicated by a `5xx` status. + Error responses have a `message` property with more information. ## Version The current version of the Analytics API is version 2, as indicated by the `/2/` in each endpoint's URL. + ## Query aggregation + + Algolia accepts queries on each keystroke. + To ensure you have relevant analytics data, however, the series of keystrokes is aggregated to keep only the latest (final) user query. + This is called "prefix" aggregation. + + For more information, see [Query agggregation and processing](https://www.algolia.com/doc/guides/search-analytics/concepts/query-aggregation/). + + See the analytics implementation overview for more information about query aggregation. version: 2.0.0 components: securitySchemes: @@ -79,13 +91,15 @@ tags: x-displayName: Clicks description: | Metrics related to click and conversion events, - such as click- and conversion rates for your search results. + such as click and conversion rates for your search results. - name: filter x-displayName: Filters - description: Metrics related to filters. + description: | + Metrics related to filters. - name: revenue x-displayName: Revenue - description: Metrics related to revenue. + description: | + Metrics related to revenue. - name: search x-displayName: Searches description: |