Best analytics for your Rails SaaS in 2026
The best analytics tools for Rails SaaS apps in 2026: cookieless options, server-side events, Hotwire/Turbo support, and MCP for AI-native workflows.
Rails is having a quiet renaissance in 2026. Hotwire, Turbo, and Stimulus make it fast enough to compete with React SPAs without the JavaScript complexity tax. But analytics for Rails SaaS has some specific challenges that most tooling ignores: Turbo navigation breaking pageview tracking, server-rendered content that never touches a JavaScript bundle, and SaaS-specific events like trial starts, billing changes, and feature usage.
This guide covers the best analytics options for Rails specifically — what tracks correctly with Turbo, what integrates cleanly with Rails conventions, and which tool gives you the best return on a SaaS stack.
The Rails SaaS analytics problem
Most analytics tools assume a React SPA or a simple static site. Rails is neither. Three things make it different:
1. Turbo Drive breaks pageview tracking. Turbo Drive intercepts link clicks and replaces the <body> without a full page reload. Analytics tools that rely on window.onload or standard DOMContentLoaded events miss every Turbo navigation. You think you’re tracking pages; you’re tracking the landing page and nothing else.
2. Server-rendered content has no JavaScript delay. Rails renders HTML on the server. Your analytics script loads after the HTML. For most tools this is fine, but it means any “time on page” or “engagement” metrics are approximate at best, and scroll tracking can misfire on fast server responses.
3. SaaS events need a real API. Counting pageviews is the start. You want to track trial conversions, plan upgrades, churned users who came back. That means events — and you want to fire them server-side from your Rails controllers, not from a JavaScript snippet in the browser.
Option 1: Measure.events
Best for: Rails SaaS developers who want cookieless analytics, a clean API, and AI-native querying
Measure.events is a privacy-first analytics platform built for developer stacks. For Rails specifically, it solves all three problems above with no configuration:
Turbo Drive support out of the box. Turbo Drive navigates with the History API, and the Measure tracking script follows pushState/popstate navigation. Every Turbo navigation fires a pageview. No configuration needed — it works automatically on Rails + Hotwire.
Installation with the Rails asset pipeline:
Add the tracking script to your application.html.erb layout:
<script defer src="https://lets.measure.events/api/script/YOUR_TRACKING_ID"></script>That’s it for pageviews. Turbo navigations are tracked automatically, and humans, AI agents (ChatGPT-User, ClaudeBot, PerplexityBot) and bots are counted separately.
Events from Rails controllers (server-side):
Measure records server-side events as paths, so a trial start becomes a hit on a path like /events/trial-started:
# config/initializers/measure.rb
MEASURE_SITE_KEY = ENV['MEASURE_SITE_KEY']
MEASURE_API_URL = "https://lets.measure.events/api/v1/events"
def track_event(path, referrer: nil)
Net::HTTP.post(
URI(MEASURE_API_URL),
{ site_key: MEASURE_SITE_KEY, path: path, referrer: referrer }.compact.to_json,
"Content-Type" => "application/json",
"Authorization" => "Bearer #{ENV['MEASURE_API_KEY']}" # mk_...
)
rescue => e
Rails.logger.warn "Measure tracking error: #{e.message}"
endFire it from any controller action:
# app/controllers/subscriptions_controller.rb
def create
@subscription = current_user.create_subscription(subscription_params)
track_event("/events/trial-started/#{@subscription.plan}")
redirect_to dashboard_path
endThe MCP server — AI-native analytics:
Measure.events ships an MCP (Model Context Protocol) server at https://lets.measure.events/mcp, which means you can query your analytics directly from Cursor, Claude Desktop, or any MCP-compatible AI tool. Ask “what pages are users visiting before they sign up?” and get an actual answer from your data — no SQL, no dashboard digging.
For a Rails SaaS, this is genuinely useful. Your LLM can see traffic patterns, server-side events, and top referrers alongside your codebase. You can ask “how many trial starts did we record this week, and how does that compare to signup-page visits?” and the answer comes from your real analytics, not a guess.
Pricing: $29/month covers up to 40 sites, then $0.50 per site per month. 14-day trial (card required). No cookies, so no cookie banner needed for Measure.
Option 2: Ahoy (Rails gem)
Best for: Developers who want analytics stored in their own Postgres and don’t need a SaaS dashboard
Ahoy is a Rails gem that stores visits and events directly in your own database. No external service, no monthly fee, no data leaving your server.
The Rails integration is as good as it gets:
# Gemfile
gem 'ahoy_matey'
# rails generate ahoy:install
# rails db:migrateTrack server-side events:
ahoy.track "trial_started", plan: @subscription.planThe downside: Ahoy gives you raw data in Postgres tables. You get no dashboard, no visualization, no referrer attribution out of the box. You’re building your own reporting layer. For a SaaS that needs to answer “how many trials converted this month?”, that’s a project, not a tool.
Ahoy also has no MCP server, no AI querying layer, and no automatic Turbo support. It tracks what you explicitly tell it to track.
Pricing: Free (open source). You pay with engineering time.
Best if: You have a data team, you’re already running a dashboarding tool like Metabase, and you want full ownership over the raw events.
Option 3: Plausible Analytics
Best for: Simple traffic analytics where cookieless tracking is the priority
Plausible is a privacy-focused analytics SaaS that works well for Rails marketing sites. Cookieless by default.
Rails installation:
<script defer data-domain="yourapp.com"
src="https://plausible.io/js/script.js"></script>For Turbo support, you need to manually configure it:
<script defer data-domain="yourapp.com"
src="https://plausible.io/js/script.js"></script>
<script>
document.addEventListener("turbo:load", function() {
if (typeof plausible !== "undefined") {
plausible("pageview");
}
});
</script>Plausible does not have a server-side Ruby SDK or an MCP server. Custom events are JavaScript-only. For SaaS analytics — trial conversions, billing events, feature usage — you’re limited to client-side JavaScript events.
Pricing: Paid plans priced by pageviews; check their site for current pricing.
Best if: You have a marketing site or documentation site built on Rails, not a SaaS app with complex event tracking needs.
Option 4: Google Analytics 4
Best for: Teams that need Google Ads integration or already have GA4 set up everywhere
GA4 works on Rails but uses cookies, which generally means a consent banner for EU users. For a SaaS, losing the conversion data of every EU visitor who declines is a real problem.
Turbo support requires custom configuration. The standard GA4 snippet does not fire on Turbo navigations:
// You need to add this manually
document.addEventListener("turbo:load", function() {
gtag("event", "page_view", {
page_title: document.title,
page_location: window.location.href
});
});GA4 has no MCP server, isn’t cookieless by default, and the interface is notoriously difficult for SaaS-specific questions.
Pricing: Free, with paid enterprise tiers.
Best if: You’re running Google Ads and need attribution data, or your organization already standardized on GA4.
The Rails SaaS analytics decision
| Feature | Measure.events | Ahoy | Plausible | GA4 |
|---|---|---|---|---|
| Turbo Drive support | ✅ Built-in | ✅ (manual events) | ⚠️ Manual config | ⚠️ Manual config |
| Server-side Ruby API | ✅ REST API | ✅ Native gem | ❌ | ❌ |
| Cookieless | ✅ | ✅ | ✅ | ❌ |
| MCP server (AI querying) | ✅ | ❌ | ❌ | ❌ |
| SaaS dashboard | ✅ | ❌ (raw DB) | ✅ (limited) | ✅ |
| Price | $29/mo (40 sites) | Free | Paid | Free |
For most Rails SaaS applications in 2026, the recommendation is Measure.events for analytics and Ahoy for internal event sourcing if you need the raw event log in Postgres. They’re not mutually exclusive.
The MCP server integration is genuinely novel. If you’re using Cursor or Claude for development — and most Rails developers are in 2026 — having your analytics queryable from your AI IDE is a productivity multiplier. “Which referrers sent the visitors who started a trial?” is a question you can answer in seconds instead of building a custom query.
Getting started
Sign up for Measure.events — 14-day trial, card required. The Rails installation takes about five minutes including the Turbo configuration, and connecting the MCP server to Cursor adds another five.
Let your agent read the numbers.
$29 a month covers 40 sites, then $0.50 a site. 14-day trial.