Install on Astro

Use your shared Astro layout so the tracker appears on every page you want to measure. Copy your website’s token from Seean → Settings → Installation. Your site must allow the script to load under its analytics-consent policy.

Add the script to your layout

Open the layout that owns <html> and <head>, commonly src/layouts/Layout.astro. Add this inside its existing <head>, replacing YOUR_SITE_TOKEN:

<script
  is:inline
  defer
  src="https://app.seean.io/k.js"
  data-site="YOUR_SITE_TOKEN"
  data-api="https://app.seean.io"
></script>

is:inline tells Astro to preserve the tag rather than process the tracker as an application module. Keep your existing layout, metadata and components. Pages that do not use this layout need the same single installation in their own document layout. Astro script handling.

ClientRouter and islands

Keep the same tag in the shared layout when using Astro’s ClientRouter. Do not add data-astro-rerun, reinstall the tracker in astro:page-load, or also load it inside a React/Vue island. The tracker already observes supported history navigation.

Test direct loads and client-side links separately, including Back and Forward. Pathnames such as /pricing are tracked; changing only #section does not create a distinct page. Astro’s script lifecycle changes with client navigation, so repeat these checks after changing layouts or routing. Astro navigation and scripts.

Publish and verify

Build and deploy your Astro project using its existing commands. Open the published URL and complete installation verification: script load, collection request and matching paths in Events. Use the matching site’s Setup health for its last received pageview time and published-homepage check.

For local testing on localhost or 127.0.0.1, add data-local to the tag and use a separate test site token. This does not override privacy or automation checks. If only some pages are missing, check which layouts those pages use and whether an exclusion matches them.

Events and removal

Call custom events only after the tracker has loaded. Remove this tag from the layout and redeploy to stop future collection; existing reports remain. Script options describe storage, supported attributes and token changes.

Something unclear? Contact support.