add analytics CSV export
All checks were successful
deploy / deploy (push) Successful in 1m25s

Downloads a ZIP with one CSV per report (overview, trend, pages, entry/exit
pages, sources, referrers, countries, devices, funnel). Export button lives
next to the period selector and picks up the current period and any active
filters using a JS hook + JS.set_attribute, so the downloaded data always
matches what's on screen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-24 09:37:45 +00:00
parent 01ff8decd5
commit 758e66db5c
4 changed files with 269 additions and 5 deletions

View File

@@ -187,6 +187,8 @@ defmodule BerrypodWeb.Router do
scope "/admin", BerrypodWeb do
pipe_through [:browser, :require_authenticated_user, :admin]
get "/analytics/export", AnalyticsExportController, :export
live_session :admin,
layout: {BerrypodWeb.Layouts, :admin},
on_mount: [