Analytics for Astro
One tag in your layout, or one prompt for your coding agent. This site is built with Astro and measured the same way.
Let your agent add it
Open Connect agent in your dashboard, click Copy setup prompt, and paste it into your coding agent. It finds your shared layout, installs the tracker once, and verifies MCP access. No StepMetrics npm package is required.
Or add it yourself
In the <head> of your layout. The is:inline directive keeps
Astro from bundling it, so it loads from our host and updates without a rebuild of your site.
<script is:inline defer src="https://app.stepmetrics.co/t.js" data-site="YOUR_SITE_ID"></script> Track the steps that matter
Pageviews are automatic. Name the actions you care about and send them with one call; each one appears on the conversions row by itself and can be a step in a funnel.
window.stepmetrics('signup');
window.stepmetrics('purchase', { plan: 'pro' }, { revenueCents: 2900, currency: 'USD' }); Conversions your server knows first, such as a payment confirmed by a webhook, post to the same endpoint from the backend. See server-side events.
Read it from your editor
Connect Claude Code, Cursor or any MCP client with a read-only key, and ask in words: which pages lost traffic this week, where mobile visitors drop out of signup, whether Tuesday's spike was a crawler. The agent gets the same numbers as the dashboard.
claude mcp add --transport http stepmetrics https://app.stepmetrics.co/mcp \
--header "Authorization: Bearer dak_..." Try it on your site.
Add your first site for free. See where visitors come from, what they look at, and how many take the next step.
No credit card required.