ActionLab Analytics for Astro
Add privacy-first, AI-powered analytics to your Astro site in under 60 seconds. No cookies, no consent banners, no complex setup.
Installation Code
Astro
---
// src/layouts/Layout.astro
---
<html>
<head>
<script
src="https://cdn.actionlabanalytics.com/actionlab.js"
data-site="YOUR_SITE_ID"
defer
is:inline
></script>
</head>
<body><slot /></body>
</html>Step-by-Step Setup
- 1
Open your base layout file (e.g., src/layouts/Layout.astro).
- 2
Add the ActionLab script tag with is:inline to prevent Astro from bundling it.
- 3
Replace YOUR_SITE_ID with your actual site ID.
- 4
Works with static and SSR Astro sites.
Why Use ActionLab with Astro
- is:inline keeps the script external (not bundled)
- Works with Astro static generation and SSR
- View Transitions navigation tracked automatically
- Matches Astro's lightweight philosophy
Frequently Asked Questions
Why use is:inline?
The is:inline directive tells Astro to leave the script tag as-is instead of bundling it. This ensures ActionLab loads from the CDN as intended.