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/lib/plausible
hq1 bbedeff683
Implement Funnels view on dashboard (#3066)
* Add Funnel react component

assets/js/dashboard/stats/behaviours/funnel.js - restored from:

98a76cbd Remove console.info calls
d94db99d Convert Funnel class component into a functional one
028036ad Review comments
3067a940 Stop doing maths in react
73407cc3 Fix error handling when local storage gets corrupted
e8c6fc52 Format numbers on funnel labels
c815709f Reorganize component responsibility
7a88fe44 Outline basic error handling
94caed7c Chart styling updates
4514608a Add percentages to funnel
d622c32d Add funnel picker

Co-authored-by: Uku Taht <uku.taht@gmail.com>

* Pass funnels list to react via data-funnels

* Implement Funnels react API

lib/plausible_web/controllers/api/stats_controller.ex - restored from:

f36ad234 Adjust to Plausible.Stats interface
9b532273 Test funnel stats controller
028036ad Review comments
bea3725f Remove IO.inspect
7a88fe44 Outline basic error handling
c8ae3eaf Move Funnels to StatsController and use base query
667cf222 Put private functions at the bottom

* Tweak funnel presentation

* Handle errors at the top

* Do not register DataLabels plugin globally

or else all the existing charts are affected

* Calculate drop-off percentage evaluating funnels

* Tweak dark mode + implement nicer tooltips

* Make currently selected funnel bold in the picker

* Count user_ids not session_ids when evaluating funnels

So if a visitor goes:

1. Start session
2. Complete funnel step 1
3. Inactive for 30 minutes
4. Complete funnel step 2

We would not be able to track this funnel completion because of the session timeout.
We like to o measure this as funnel completion even though the session expired in the middle.

cc @ukutaht

* Add extra properties to the funnels API

cc @ukutaht

* Improve tooltips so that step to data is rendered

* Change tooltip number formatting

* Remove debugging remnants

* Quick & dirty mobile view

* Fix mobile view: tweak dark mode & funnel switching

* Ignore DOMException: the operation was aborted

Otherwise this sometimes flashes the space shuttle
screen when navigating quickly via a keyboard.

* Format percentages on the main chart

* Close missing tag 🙈

* Revert "Close missing tag 🙈"

This reverts commit 9c2f970e22fd7e2980503242b414f42ce8bce1d2.

* Use jsx to render funnel tooltip

To get markup validated via lsp mostly...

* Fixup: s/class/className

* Fix className interpolation

* Add a ruler to the tooltip

* Tweak funnel chart style

* Fix font distortion issue on chart/canvas labels

* s/class/className

* Put "Set up funnels" link behind a feature flag

* Refactor internal selection storage

Getting ready for live funnel evaluation

* Don't try to connect LV socket if there's no CRSF token set up

This is perfectly okay for some of the templates/layouts.

* Fix up funnel creation typespecs

Unfortunately we can't define a type with literal string keys,
hence this must suffice.

* Use uniq over count/distinct

* Revert JSX in tooltips

Ref: https://github.com/plausible/analytics/pull/3066#discussion_r1241891155

* Remove the extra query for counting all visitors

cc @ukutaht

* Add premium notice

---------

Co-authored-by: Uku Taht <uku.taht@gmail.com>
3 years ago
..
auth Wrap user deletion in DB transaction (#2964) 4 years ago
billing Ignore missing subscription on update (#2930) 4 years ago
data_migration use ecto_ch (#2890) 4 years ago
event Clean up after V2 migration (#2868) 4 years ago
funnel Implement backend core for funnels (#3023) 3 years ago
goal Add notice to revenue goals UI (#3069) 3 years ago
google use ecto_ch (#2890) 4 years ago
helpers improve transfer ownership error message (#2651) 4 years ago
imported Switch to new clickhouse adapter (ch/chto) (#2733) 4 years ago
ingestion Pass cached site struct down the ingestion pipeline (#3027) 3 years ago
sentry Use finch in sentry client (#1996) 4 years ago
session Clean up after V2 migration (#2868) 4 years ago
site Pass cached site struct down the ingestion pipeline (#3027) 3 years ago
stats Implement Funnels view on dashboard (#3066) 3 years ago
telemetry Gatekeep ingestion pipeline (#2472) 4 years ago
application.ex Split clickhouse repos - making the main one read only (#2826) 4 years ago
async_insert_repo.ex Switch to new clickhouse adapter (ch/chto) (#2733) 4 years ago
cldr.ex Revenue tracking: Add currency field to goal creation (#2948) 4 years ago
clickhouse_event_v2.ex Revenue tracking: Ingestion and breakdown queries (#2957) 3 years ago
clickhouse_repo.ex Switch to new clickhouse adapter (ch/chto) (#2733) 4 years ago
clickhouse_session_v2.ex use ecto_ch (#2890) 4 years ago
data_migration.ex Make self-hosted data migration easier (#2865) 4 years ago
funnel.ex Implement backend core for funnels (#3023) 3 years ago
funnels.ex Implement Funnels view on dashboard (#3066) 3 years ago
geo.ex Stop logging invalid_address errors from Locus (#2604) 4 years ago
goals.ex Funnel site settings (#3039) 3 years ago
http_client.ex Trace external HTTP requests (#2419) 4 years ago
import_deletion_repo.ex Split clickhouse repos - making the main one read only (#2826) 4 years ago
ingest_repo.ex Switch to new clickhouse adapter (ch/chto) (#2733) 4 years ago
mailer.ex Do not report hard bounce e-mail errors to Sentry (#2361) 4 years ago
mailer_test.exs Do not report hard bounce e-mail errors to Sentry (#2361) 4 years ago
open_telemetry.ex Remove ingestion requests and Oban queries from OTEL (#2543) 4 years ago
prom_ex.ex Add extra error info + telemetry for AsyncInsertRepo (#2708) 4 years ago
purge.ex Split clickhouse repos - making the main one read only (#2826) 4 years ago
repo.ex Pagination for sites listing (#994) 6 years ago
site.ex Funnel site settings (#3039) 3 years ago
sites.ex Associate goals with sites, not domains (#2828) 4 years ago
stats.ex Implement backend core for funnels (#3023) 3 years ago
themes.ex Adds dark mode to entire dashboard (#467) 6 years ago
timezones.ex Fix timezone list when time changes (#2268) 4 years ago