Skip to main content

install

Analytics for Astro, in one tag

A 1.2 KB core, no cookies and no stored IP. Replace YOUR_TOKEN with your site token to measure visits and sources, and connect Stripe, Lemon Squeezy, Paddle, or the revenue API to see the revenue behind them.

  1. Copy your site token

    It is in Dashboard → Settings → Install, inside the snippet. Before launch, you get a dashboard once we pick your account for the beta.

  2. Paste the snippet

    Once, in a place every page loads. Replace YOUR_TOKEN with your token.

    Astrosrc/layouts/Layout.astro
    <head>
      <script defer src="https://api.getvero.dev/t.js?s=YOUR_TOKEN"></script>
    </head>

    Add the tag to your shared layout head so it loads on every page.

  3. Deploy and open your site

    Vero counts visits to your domain and its subdomains, so a localhost test never shows up. With the snippet live, open your site in another tab: your dashboard notices the first visit by itself.

Putting the tag in an Astro layout

Most Astro sites render their pages through a shared layout such as src/layouts/Layout.astro. Put the tag in that layout's head and every page built on it loads the tracker. A page that skips the layout skips the tag as well, so check any standalone page you care about.

Without view transitions, every link on an Astro site is a full page load, and the core counts it with nothing else switched on. Turn view transitions on and navigation stays inside one document. The SPA module is what turns those swaps into pageviews, because it follows History API changes to the path or the query.

When you add an Astro site, Vero reads the home page, recognises astro-island or data-astro- attributes, shows you the Astro snippet and switches SPA on, along with scroll, engagement, outbound and leave. If your site never uses view transitions, turn SPA off in Dashboard → Settings → Install and the script your visitors download gets smaller.

Troubleshooting

Visits on my pages.dev address are ignored

If you deploy to Cloudflare Pages and the Vero site is your own domain, the *.pages.dev address is a different host. Vero counts only visits from the site's domain, its www or apex, and its subdomains, so the dashboard flags the preview and drops those beacons. Run an install test against the preview URL to confirm the tag works there without it counting.

My data is not showing up

Frequently asked

Do I need the SPA module on an Astro site?

Only if you use view transitions. Without them each link reloads the page, and the core already sends that pageview.

Will the back button count a page twice?

If the browser restores the page from its back/forward cache, the core sends a pageview again, since the visitor is seeing that page again.

Is the tag the same on every page?

Yes. The script reads its token from its own src, so one line in the layout serves the whole site.

IntegrationsPricing

After the tag

Hand-picked beta, waitlist open

Ask for a place in the beta.

Anyone can join the list. The accounts we pick get Pro free for the whole beta.

By joining you agree to receive launch updates and accept our Privacy Policy.

See the demo