Analytics for Astro · Astro integration

Your site.
Your analytics choices.

Connect your Astro or Starlight site to the analytics providers you choose. Track pageviews and custom events, and connect tracking to your site’s consent choices.

What you can do

One integration.
Room to choose.

01

Choose your providers

Connect Fathom, Plausible, Google Analytics 4, Matomo, or Umami. Use one provider or several together.

02

Follow page visits

Track pageviews on normal page loads and as visitors navigate with Astro’s ClientRouter.

03

Record custom events

Use a shared event API across providers, with a result for each provider.

04

Connect consent choices

Use runtime consent controls to connect tracking to the choices made through your site’s consent interface.

Get started

Add analytics.
Keep control.

npm install --save-exact @codeworkslabs/astro-analytics@0.1.0

Follow the documentation to configure your providers, choose how pageviews are tracked, and connect your consent controls.

Read the setup guide →
Consent and delivery

If you use consent gating, your site supplies the consent banner and remembers visitors’ choices. The integration provides runtime controls; it does not include an event queue or retry failed events. A provider accepting an event in the browser does not confirm delivery to its server.