Best Analytics for Your Rails SaaS in 2026
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 misfires on fast server responses.
3. SaaS events need a real API. Counting pageviews is the start. You want to track trial conversions, feature flags, plan upgrades, churned users who came back. That means custom 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. The Measure tracking script uses a turbo:load event listener in addition to the standard DOMContentLoaded. 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 async src="https://lets.measure.events/track.js"
data-site-key="YOUR_SITE_KEY"></script>
That’s it for pageviews. Turbo navigations are tracked automatically.
Custom events from Rails controllers (server-side):
# config/initializers/measure.rb
MEASURE_SITE_KEY = ENV['MEASURE_SITE_KEY']
MEASURE_API_URL = "https://lets.measure.events/api/v1/events"
def track_event(name, properties = {})
Net::HTTP.post(
URI(MEASURE_API_URL),
{ site_key: MEASURE_SITE_KEY, name: name, properties: properties }.to_json,
"Content-Type" => "application/json",
"Authorization" => "Bearer #{ENV['MEASURE_API_KEY']}"
)
rescue => e
Rails.logger.warn "Measure tracking error: #{e.message}"
end
Fire it from any controller action:
# app/controllers/subscriptions_controller.rb
def create
@subscription = current_user.create_subscription(subscription_params)
track_event("trial_started", { plan: @subscription.plan, source: params[:source] })
redirect_to dashboard_path
end
The MCP server — AI-native analytics:
This is the feature no other analytics tool has in 2026. Measure.events ships an MCP (Model Context Protocol) server, 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 churn?” 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, conversion funnel data, and top referrers alongside your codebase. You can ask “where are users dropping off in the signup flow?” and the answer comes from your real analytics, not a guess.
Pricing: $29/month, 14-day free trial. Cookieless — no GDPR consent banner required.
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:migrate
Track server-side events:
ahoy.track "trial_started", plan: @subscription.plan
The 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 compliance is the priority
Plausible is a privacy-focused analytics SaaS that works well for Rails marketing sites. Cookieless, GDPR compliant, no consent banner required.
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: From $9/month (100K pageviews/month). Goes up quickly for high-traffic apps.
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 requires a consent banner for EU users (GDPR requires consent for cookie-based tracking). For a SaaS, losing 30-50% of your conversion data because EU users declined 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, no cookieless mode (sampling-based approaches exist but are not the default), and the interface is notoriously difficult for SaaS-specific questions.
Pricing: Free (up to 10M events/month), then scales.
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 / No consent banner | ✅ | ✅ | ✅ | ❌ |
| MCP server (AI querying) | ✅ | ❌ | ❌ | ❌ |
| SaaS dashboard | ✅ | ❌ (raw DB) | ✅ (limited) | ✅ |
| Price | $29/mo | Free | $9/mo+ | 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. “What’s the drop-off point in my onboarding flow?” is a question you can answer in seconds instead of building a custom query.
Getting Started
Sign up for Measure.events — 14-day free trial, no credit card required. The Rails installation takes about five minutes including the Turbo configuration.
The MCP server setup for Cursor adds another five minutes and is documented at lets.measure.events/docs.
Ready to see accurate analytics?
No cookies. No consent banners. No personal data. $29/mo with a 14-day free trial.
Start free trial →