You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
analytics/test/plausible_web/controllers/api/stats_controller
Vini Brasil e4d4f7d954
Revenue tracking: Ingestion and breakdown queries (#2957)
* Add revenue fields to ClickHouse events

This commit adds 4 fields to the ClickHouse events_v2 table:

* `revenue_source_amount` and `revenue_source_currency` store revenue in
  the original currency sent during ingestion

* `revenue_reporting_amount` and `revenue_reporting_currency` store
  revenue in a common currency to perform calculations, and this
  currency is defined by the user when setting up the goal

The type of amount fields is `Nullable(Decimal64(3))`. That covers all
fiat currencies and allows us to store huge amounts. Even though
ClickHouse does not suggest using `Nullable`, this is a good use case,
because otherwise additional work would have to be done to
differentiate missing values from real zeroes.

I ran a benchmark with the data pattern we expect in production, where
we have more missing values than real decimals. I created 100 million
records where 90% of decimals are missing. The difference between the
tables in storage is just 0.4Mb.

* Add revenue parameter to Events API

This commit adds support for sending revenue data in ingestion using the
`revenue` parameter - aliased to `$`.

* Add revenue parameter to mix send_pageview

* Add average and total revenue to breakdown queries
3 years ago
..
authorization_test.exs Google APIs integration improvements (#2358) 4 years ago
browsers_test.exs Replace empty OS/screen size/Browser with `(not set)` in UI/API/exports (#2646) 4 years ago
cities_test.exs Reject unknown imported cities from queries (#2675) 4 years ago
conversions_test.exs Revenue tracking: Ingestion and breakdown queries (#2957) 3 years ago
countries_test.exs Fix breakdown API pagination when using event metrics (#2562) 4 years ago
current_visitors_test.exs Conditionally support switching between v1 and v2 clickhouse schemas (#2780) 4 years ago
main_graph_test.exs Prevent overwriting with_imported when comparing (#2871) 4 years ago
operating_systems_test.exs Replace empty OS/screen size/Browser with `(not set)` in UI/API/exports (#2646) 4 years ago
pages_test.exs Prop filter modal (#2841) 4 years ago
regions_test.exs Harden API input validation (#2869) 4 years ago
screen_sizes_test.exs Support multiple filters - backend (#2749) 4 years ago
sources_test.exs Stop treating page filter as an entry_page filter (#2752) 4 years ago
suggestions_test.exs Filter out garbage props by `site.allowed_event_props` (#2907) 4 years ago
top_stats_test.exs Fix conversions top stats bug when comparing (#2893) 4 years ago