Skip to content

Commit

Permalink
fix(specs): extend Analytics descriptions (#4360)
Browse files Browse the repository at this point in the history
Co-authored-by: Gary Conroy <gary.conroy@LON-M3P-GConroy.local>
Co-authored-by: Kai Welke <kai.welke@algolia.com>
  • Loading branch information
3 people authored Jan 16, 2025
1 parent 074eea3 commit 22167b8
Show file tree
Hide file tree
Showing 22 changed files with 143 additions and 37 deletions.
24 changes: 12 additions & 12 deletions specs/analytics/common/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -195,15 +192,17 @@ 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

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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion specs/analytics/common/schemas/getTopFiltersNoResults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
11 changes: 10 additions & 1 deletion specs/analytics/paths/click/getAddToCartRate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 4 additions & 1 deletion specs/analytics/paths/click/getAverageClickPosition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions specs/analytics/paths/click/getClickPositions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 6 additions & 1 deletion specs/analytics/paths/click/getClickThroughRate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 6 additions & 1 deletion specs/analytics/paths/click/getConversionRate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
11 changes: 10 additions & 1 deletion specs/analytics/paths/click/getPurchaseRate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 5 additions & 2 deletions specs/analytics/paths/revenue/getRevenue.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
get:
tags:
- click
- revenue
operationId: getRevenue
x-acl:
- analytics
summary: Retrieve revenue data
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'
Expand Down
1 change: 1 addition & 0 deletions specs/analytics/paths/search/getNoClickRate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions specs/analytics/paths/search/getNoResultsRate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion specs/analytics/paths/search/getSearchesNoClicks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 3 additions & 2 deletions specs/analytics/paths/search/getSearchesNoResults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion specs/analytics/paths/search/getTopCountries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion specs/analytics/paths/search/getTopFilterAttributes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion specs/analytics/paths/search/getTopFilterForAttribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion specs/analytics/paths/search/getTopFiltersNoResults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
25 changes: 24 additions & 1 deletion specs/analytics/paths/search/getTopHits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
25 changes: 24 additions & 1 deletion specs/analytics/paths/search/getTopSearches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 5 additions & 3 deletions specs/analytics/paths/search/getUsersCount.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 3 additions & 1 deletion specs/analytics/paths/status/getStatus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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&nbsp;minutes.
parameters:
- $ref: '../../../common/parameters.yml#/Index'
responses:
Expand Down
Loading

0 comments on commit 22167b8

Please sign in to comment.