Muro is live on RocketHub.Get the deal →

Static site framework

Analytics for Astro

Add Muro to your Astro site without hurting your Lighthouse score.

30-day free trial. No credit card. Cancel anytime.

Why analytics matter for Astro sites

Astro sites are built for speed. The whole point is to ship as little JavaScript as possible, and heavy analytics scripts work against that. Muro is one async script under 2 KB. It counts pageviews, sources, and view transitions without eating into your performance budget, and sends you a short plain-English summary every morning.

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). Visits show up in your Muro dashboard within seconds of going live.

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, automatically

View transitions and client-side navigation, with no extra config

Where your visitors come from: referrers, UTM campaigns, and social links

Custom events you fire from islands or scripts, or tag with data-muro-event

Signups and other goals, when you mark a thank-you page as a goal

Real situations where Muro helps Astro users

These are the kinds of moments where a short morning email beats remembering to open a dashboard.

01

Your tutorial section drives most of your signups

Mark your signup confirmation page as a goal and Muro shows conversion rate by entry page. Since goals count past visits, you can see right away which section of your site brings the most signups.

02

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

Muro shows how many visitors Hacker News sent and which pages they landed on. With a signup goal, you'll see how HN visitors converted next to your other sources.

03

A specific blog post starts ranking on Google

Muro shows your top pages in the daily brief. When a post starts ranking, you'll see it there.

What you'll actually get

Alongside a full dashboard, Muro sends a short plain-English summary every morning. Here's the kind of note a Astro site might see.

Alert

First visitors from Brazil

38 people from Brazil visited your site yesterday, the first time Brazil has shown up in your traffic.

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 so Muro doesn't block rendering.

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 keeps it safe if the script hasn't loaded yet. For plain buttons and links, a data-muro-event attribute works too.

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

Common questions about Muro on Astro

It shouldn't. Muro is under 2 KB and loads asynchronously, so it doesn't block rendering or shift your layout.

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

Setup takes 2 minutes. Your first morning brief arrives tomorrow at 8 AM.

30-day free trial. No credit card. Cancel anytime.