# SvelteKit (https://talivia.com/docs/installation-guides/svelte-kit)



Use the app template so Talivia loads once for the whole SvelteKit site.




## Add the script [#add-the-script]

Open `src/app.html` and place the snippet before the closing `</body>` tag.

```html
<body data-sveltekit-preload-data="hover">
  <div style="display: contents">%sveltekit.body%</div>
  <script defer src="https://talivia.com/script.js" data-website-id="YOUR_WEBSITE_ID"></script>
</body>
```

Replace the website ID. Copy the ID from Talivia Settings -> Tracking.

Talivia tracks normal page views and client-side route changes after the script loads.
