Skip to content

Commit 868ff3a

Browse files
authored
Merge pull request #637 from plausible/apiv2-nuances
Document APIv2 quirks
2 parents 2462e55 + d2fd1e9 commit 868ff3a

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

docs/stats-api.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,3 +455,20 @@ In this example, we're counting goal completions for a goal named "Signup" for u
455455
<ApiV2Example id="example-behavioral-filters" />
456456

457457
</SiteContextProvider>
458+
459+
## Quirks
460+
461+
The stats API is created to be able to both pragmatically and performantly query the underlying dataset Plausible stores. To make
462+
it possible, the API has certain limitations and quirks. These include:
463+
464+
### Imported data can not always be included
465+
466+
As imported data from Google Analytics or other sources is stored as aggregates, responses for queries with certain metrics,
467+
filters and dimensions may not contain imported data. [See example](#example-imports-warning)
468+
469+
### Metric values may change depending on metrics requested
470+
471+
When requesting metrics such as `visits` or `visitors`, the system may use different database tables depending on your query and use
472+
different heuristics to calculate values. As such, the value may slightly change depending on the result.
473+
474+
Our testing has shown this to be a small effect (less than 1 percent).

src/js/apiv2-examples/revenue-warning-response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"results": [
3-
{"metrics": [null], "dimensions": ["Visit /"]}
3+
{"metrics": [null], "dimensions": ["PurchaseUSD"]}
44
],
55
"meta": {
66
"metric_warnings": {

0 commit comments

Comments
 (0)