/Docs
Register

SvelteKit

Add Reignat analytics to your SvelteKit app.

Via app.html

The simplest approach: add the script to src/app.html before </body>:

HTMLsrc/app.html
<!DOCTYPE html><html lang="en">  <head>%sveltekit.head%</head>  <body>    <div>%sveltekit.body%</div>     <script      src="https://www.reignat.com/tracker.js"      data-site="your-project-id"      defer    ></script>  </body></html>

Via +layout.svelte

To load the tracker from your Svelte component tree, add it in src/routes/+layout.svelte:

src/routes/+layout.svelte
<script>  import { onMount } from "svelte"  import { page } from "$app/stores"   onMount(() => {    const script = document.createElement("script")    script.src = "https://www.reignat.com/tracker.js"    script.dataset.site = "your-project-id"    script.defer = true    document.head.appendChild(script)  })</script> <slot />
Reignat's tracker listens to history.pushState automatically, so SvelteKit client-side navigation is tracked without extra setup.

Verify

Deploy and visit your site. Check your Reignat dashboard: a pageview should appear within seconds.

Reignat ignores localhost automatically. Always test on your deployed URL.