SvelteKit provides several ways to integrate third-party scripts. Here are the recommended approaches for adding Visitors analytics.
Replace YOUR_TOKEN with your project token.
The simplest approach is to add the script tag directly to your src/app.html file.
You can also add the script using Svelte's svelte:head in your root layout:
For more control over when the script loads: