Static site framework

Analytics for Astro

Add Muro to your Astro site without breaking your perfect Lighthouse score.

No credit card required. Takes 2 minutes.

Why analytics matter for Astro sites

Astro sites are built for speed. The whole point is to ship as little JavaScript as possible. Most analytics tools wreck that by loading 50KB of script. Muro is one async script under 5KB. It tracks everything you need without affecting your performance budget or your Lighthouse score.

How to add Muro to Astro

Adding Muro to an Astro site takes about two minutes:

01

Open your Layout component

Open src/layouts/Layout.astro (or whatever your shared layout file is called). This is the file that wraps every page on your site.

02

Add the Muro script

Inside the <head> tag, add: <script async src="https://api.muroanalytics.com/muro.js" data-project-id="YOUR_KEY"></script>. The async attribute ensures it doesn't block rendering.

03

Build and deploy

Run astro build and deploy to your host (Vercel, Netlify, Cloudflare, wherever). Muro starts tracking immediately on the live URL.

Works with every Astro adapter (Vercel, Netlify, Cloudflare, Node) and content collections. Compatible with Astro islands using React, Vue, Svelte, Solid, etc.

What Muro tracks on Astro

Once installed, Muro tracks the things that matter — automatically.

Pageviews across every Astro page and route

View transitions and client-side navigation

Form submissions and conversion events

Traffic sources, devices, and countries

Custom events you fire from islands or scripts

Real situations where Muro helps Astro users

These are the kinds of moments where a daily insight email beats a dashboard.

01

Your tutorial section drives most of your signups

Muro tracks pageviews and conversions per content collection. After a few weeks, you'll know which section of your site is doing the heavy lifting and where to focus more content.

02

You launched on Hacker News and want to see how it converted

Muro tracks every visitor by source. You'll get a recap the next morning that says 'HN brought 4,200 visitors and 73 signups, all on the home page' so you know whether to write more.

03

A specific blog post starts ranking on Google

Muro flags traffic shifts automatically. You'll see the post called out in your daily summary so you can update it, link to it from new posts, or write a follow-up.

What you'll actually get

Muro doesn't show you charts. It tells you what matters. Here's an example insight a Astro site might receive.

Summary

Your tutorial section drove most of last month's signups

Posts in /tutorials brought 73% of email signups in the past 30 days. Worth maintaining publishing cadence there or building a dedicated landing page promoting tutorials.

Tips for getting more out of Muro on Astro

Quick wins from people who use Muro every day.

Add the script in your shared Layout.astro, not in individual page files. That way every new page automatically gets tracking.

Use the async attribute on the script tag. It ensures Muro doesn't block rendering and keeps your Lighthouse score perfect.

Astro's view transitions are tracked as separate pageviews. No extra config needed.

If you fire custom events from islands (React, Svelte, Vue), use window.muro?.track('event_name'). The optional chaining handles SSR safely.

Astro content collections (your blog, docs, etc.) work fine. Muro tracks every generated page automatically.

Common questions about Muro on Astro

No. Muro is under 5KB and loads asynchronously, so it won't impact LCP, CLS, or other Core Web Vitals.

Yes. Muro detects route changes triggered by Astro's view transitions and tracks them as separate pageviews automatically.

Yes. Muro tracks all rendered pages, including dynamically generated pages from content collections.

Yes. The script is framework-agnostic. You can also fire custom events from inside any island component using window.muro.track().

Try Muro on your Astro site

Start your 30-day free trial. No credit card required.

$5/month after the trial. Cancel anytime.