Quarterdeck
A beautiful analytics dashboard engine for Rails apps already using ahoy_matey for tracking. Quarterdeck reads your existing Ahoy data and presents it in a modern dashboard with charts, tables, and filters.
No database migrations needed — Quarterdeck reads directly from your ahoy_visits and ahoy_events tables.
Features
- Overview — Total visits, unique visitors, events, daily chart, top pages, referrers, browsers, devices, OS, countries, campaigns
- Visits — Searchable/filterable visit log with pagination and detail views
- Events — Event breakdown with daily chart, filtering by event name
- Campaigns — UTM breakdowns (source, medium, campaign, term, content) with charts
- Geographic — Country, region, and city breakdowns with charts
- Live — Real-time active visitors, current pages, and live event stream
- Trend comparisons — Stat cards show % change vs previous period
- Custom date ranges — Pick arbitrary start/end dates alongside preset periods
- CSV export — Download data from any page
Built with Tailwind CSS, Chart.js, and Stimulus.
Requirements
Your Rails app must have the following set up before installing Quarterdeck:
- Rails 8.1+
- ahoy_matey 4+ — already installed and tracking visits/events
- importmap-rails — for JavaScript module loading
- stimulus-rails — for interactive UI components
Installation
Add to your Gemfile:
gem "quarterdeck"Run the install generator:
bundle install
rails generate quarterdeck:installThis will:
- Create
config/initializers/quarterdeck.rb - Mount the engine at
/analyticsin your routes
Or set up manually:
# config/routes.rb
mount Quarterdeck::Engine => "/analytics"Configuration
# config/initializers/quarterdeck.rb
# Require authentication
Quarterdeck.authenticate_with do
redirect_to main_app.root_path unless current_user&.admin?
endPages
| Path | Description |
|---|---|
/analytics |
Overview dashboard |
/analytics/visits |
Visit log with filters |
/analytics/visits/:id |
Visit detail with events |
/analytics/events |
Event breakdown |
/analytics/campaigns |
UTM campaign analysis |
/analytics/geographic |
Geographic breakdown |
/analytics/live |
Real-time active visitors |
All pages support period filtering: Today, 7 days, 30 days, 90 days, or a custom date range.
Development
bundle install
bundle exec rspecLicense
The gem is available as open source under the terms of the MIT License.
