New: Free plan is live 7 August 2026 · View changelog →
Antlytics logoAntlytics

SvelteKit

Install

npm install @antlytics/svelte

Usage

Add the <Analytics> component to your root layout (src/routes/+layout.svelte):

<!-- src/routes/+layout.svelte -->
<script>
  import { Analytics } from '@antlytics/svelte'
</script>

<Analytics trackingId="YOUR_TRACKING_ID" />
<slot />

The component loads the hosted tracker.js (SPA navigations, 30-minute idle visits, sticky UTMs, engagement). No additional configuration required.

Props

PropRequiredDefaultDescription
trackingIdYesUUID from Antlytics → Sites
apiHostNohttps://www.antlytics.comUse your own first-party proxy

Verify data is flowing

Start your dev server (vite dev) and open the app in a browser. Check the real-time count in your Antlytics dashboard — data appears within seconds.

See Troubleshooting for common issues.

Something missing? Get in touch and we will update these docs.