Best Analytics for Astro (2026)
Compare the best analytics solutions for Astro. We review Plausible, Fathom, Umami, and more with privacy compliance, minimal JavaScript, and static site support.
Astro's focus on minimal JavaScript makes analytics choices important. You don't want a heavy analytics script undoing Astro's performance benefits. Privacy-first analytics that don't require cookie banners align well with Astro's philosophy. Most Astro sites are content-focused, so simple web analytics often suffice over complex product analytics.
Why This Matters
Astro sites are typically fast by default. Adding a 45KB Google Analytics script defeats the purpose. Modern privacy-focused analytics are tiny (<1KB), respect user privacy, and give you the traffic insights you need without the bloat or legal complexity.
Key Considerations
Script Size
Astro optimizes for performance. Plausible is <1KB, Fathom is ~1KB, Google Analytics is 45KB+. Choose lightweight options to preserve Astro's speed benefits.
Privacy & Cookies
Privacy-first analytics (Plausible, Fathom, Umami) don't use cookies and don't need consent banners. Perfect for content sites where simplicity matters.
Static Site Support
Astro generates static HTML. Analytics must work client-side. All analytics work with static sites, but some have better Astro integrations.
Astro Integrations
Some analytics have official Astro integrations that handle script injection. Others require manual <script> tags in your layout.
Self-Hosted Options
Plausible and Umami can be self-hosted for free. Good for privacy-conscious projects or cost savings at scale.
Our Recommendations
Plausible Analytics
Best Overall Excellent Support Official SDKPlausible is perfect for Astro: <1KB script, no cookies, simple dashboard. Official Astro integration available. EU-hosted, GDPR-compliant by design. Self-host or use cloud ($9/month). The go-to choice for Astro content sites.
npx astro add @plausible/astro Fathom Analytics
Best Simple Analytics Good Support Official SDKFathom is Plausible's main competitor: privacy-first, no cookies, beautiful dashboard. Slightly more expensive but excellent uptime and support. ~1KB script. Great for professional sites needing reliable analytics.
npm install @fathom/astro Umami
Best Self-Hosted Good Support Official SDKUmami is a beautiful open-source analytics you can self-host for free. Privacy-focused, lightweight script. Deploy on Railway, Vercel, or your own server. Great free alternative to paid services.
npm install @umami/astro PostHog
Best for Product Good Support Official SDKIf your Astro site has interactive islands needing product analytics (funnels, events, session recordings), PostHog works. Larger script but more features. 1M events/month free. Overkill for simple content sites.
npm install posthog-js Simple Analytics
Simplest Option Good SupportSimple Analytics lives up to its name: minimal, privacy-focused, no-cookie analytics. Just add a script tag. No Astro integration needed - it's that simple. Good for developers who want zero configuration.
<script async src="https://scripts.simpleanalyticscdn.com/latest.js"></script> Quick Comparison
| Service | TypeScript | Edge | Free Tier | Setup Time |
|---|---|---|---|---|
| | full | ✓ | Self-host only | 5 min |
| | full | ✓ | None | 5 min |
| | full | ✓ | Self-host free | 15 min |
| | full | ✓ | 1M events/mo | 10 min |
| | full | ✓ | None | 2 min |
Quick Start
import { defineConfig } from 'astro/config';
import plausible from '@plausible/astro';
export default defineConfig({
integrations: [
plausible({
domain: 'yourdomain.com',
// Optional: self-hosted instance
// src: 'https://plausible.yourdomain.com/js/script.js',
}),
],
}); Common Integration Patterns
Plausible Cloud
Plausible cloud for simple, privacy-focused analytics. Official Astro integration, <1KB script, no cookies. Best for most Astro sites.
Umami Self-Hosted
Self-host Umami on Railway or Vercel for free analytics. Full data ownership, no usage limits. Good for cost-conscious projects.
PostHog for Apps
If your Astro site has React/Svelte islands with complex interactions, use PostHog for product analytics, session recordings, and feature flags.