Install Analytise on Astro
One line in your base layout covers every page on the site.
Add it to your layout
- Open your shared layout (e.g.
src/layouts/BaseLayout.astro). - Paste the snippet inside the
<head>. - Run
astro buildand deploy.
---
// src/layouts/BaseLayout.astro
---
<html lang="en">
<head>
<meta charset="utf-8" />
<title>{Astro.props.title}</title>
<script
defer
data-domain="yourwebsite.com"
data-site-id="YOUR_SITE_ID"
src="https://www.analytise.com/js/tracker.js">
</script>
</head>
<body>
<slot />
</body>
</html>Verify it works
- Open your website in a new tab.
- The dashboard shows your visit under
onlinewithin a few seconds (live visitors update every ~15s). - Nothing showing? See Troubleshooting.
Next guide
Vue.js