add dashboard filtering to analytics
All checks were successful
deploy / deploy (push) Successful in 1m19s
All checks were successful
deploy / deploy (push) Successful in 1m19s
Click any row in pages, sources, countries, or devices tables to filter the entire dashboard by that dimension. Active filters show as dismissible chips. Filters thread through all queries including previous-period deltas. 1050 tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,23 +1,25 @@
|
||||
# Analytics dashboard v2
|
||||
|
||||
Status: Planned
|
||||
Status: In progress
|
||||
|
||||
## Current state (v1)
|
||||
|
||||
- Unique visitors, pageviews, bounce rate, visit duration
|
||||
- SVG bar chart for visitor trends
|
||||
- HTML/CSS bar chart with tooltip hover, hourly today view, readable labels
|
||||
- Date range picker (Today, 7d, 30d, 12m)
|
||||
- Top pages, sources/referrers, countries, devices
|
||||
- E-commerce conversion funnel (product view → cart → checkout → purchase)
|
||||
- Data collection: UTMs, referrers, browser, OS, screen size, full e-commerce funnel
|
||||
- Period comparison deltas on stat cards (↑12%, ↓3%)
|
||||
- Demo seed data spanning 2 years for meaningful comparisons
|
||||
|
||||
## Improvements (priority order)
|
||||
|
||||
### 1. Comparison mode
|
||||
|
||||
Compare current period vs previous period. Show deltas on each metric (↑12%, ↓3%). Already have date ranges — just query the previous period in parallel and render the difference. Low effort, high value.
|
||||
~~Compare current period vs previous period.~~ Done (6eda1de). Each stat card shows percentage delta vs equivalent previous period. Handles zero-baseline (shows "new"), caps extreme deltas at >999%. Bounce rate uses inverted colour logic (lower = green). Seed data extended to 2 years.
|
||||
|
||||
**Files:** `lib/berrypod/analytics.ex` (queries), `lib/berrypod_web/live/admin/analytics.ex` (UI)
|
||||
**Files:** `lib/berrypod_web/live/admin/analytics.ex` (date range calc, delta display), `priv/repo/seeds/analytics.exs` (2-year data)
|
||||
|
||||
### 2. Dashboard filtering
|
||||
|
||||
|
||||
Reference in New Issue
Block a user