How plausible/analytics works
Plausible is privacy-focused web analytics. A site owner installs the lightweight tracker; it captures pageviews and configured interactions, sends events for processing, and users inspect aggregated results in dashboards or through APIs. The repository also supports goals, funnels, imports, sharing, team access, and integrations. The tracker-to-event and query-to-results links are visible in excerpts; other workflow links below rely on README descriptions. Several backend subsystems are represented by their exact enclosing directories because their implementation was not sampled.
Main entry points: track.js Browser tracker · external_query_api_controller.ex Stats API · api Events API · ingestion Event ingestion
Components 19
Collection
- Browser tracker
tracker/src/track.js - Interaction tracking
tracker/src/custom-events.js - Events API
lib/plausible_web/controllers/api - Event ingestion
lib/plausible/ingestion - Analytics event store
lib/plausible/clickhouse_repo.ex
Analytics
- Analytics dashboard
lib/plausible_web/controllers/stats_controller.ex - Query parsing
lib/plausible/stats/api_query_parser.ex - Query building
lib/plausible/stats/query_builder.ex - Query execution
lib/plausible/stats/clickhouse.ex - Goals and conversions
lib/plausible/goals/goals.ex - Funnels
extra/lib/plausible/funnels.ex - Stats API
lib/plausible_web/controllers/api/external_query_api_controller.ex
Access and sharing
- Site setup
lib/plausible_web/controllers/site_controller.ex - Authentication and teams
lib/plausible/auth - Shared dashboards
lib/plausible/site/shared_link.ex
Integrations and operations
- Historical data imports
lib/plausible/imported - Search Console integration
lib/plausible/google/search_console - Reports and alerts
lib/plausible/site
Other components
- Site owner
Connections 18
- Site owner → Site setup: sets up site
README.md - Site owner → Browser tracker: installs script
README.md - Browser tracker → Events API: sends events
README.md - Interaction tracking → Browser tracker: tracks interactions
tracker/src/custom-events.js - Events API → Event ingestion: accepts events
README.md - Event ingestion → Analytics event store: persists events
README.md - Site owner → Analytics dashboard: views insights
README.md - Stats API → Query parsing: parses query
lib/plausible_web/controllers/api/external_query_api_controller.ex - Stats API → Query execution: runs query
lib/plausible_web/controllers/api/external_query_api_controller.ex - Query parsing → Query building: builds query
- Query building → Query execution: prepares SQL
- Site owner → Goals and conversions: defines conversions
README.md - Site owner → Funnels: analyzes funnels
README.md - Site owner → Historical data imports: imports history
README.md - Site owner → Search Console integration: connects search data
README.md - Site owner → Shared dashboards: shares dashboard
README.md - Site owner → Authentication and teams: manages team
README.md - Site owner → Reports and alerts: receives reports
README.md