1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-25 07:49:37 +02:00

refactor: Add analytics script to layout for tracking website usage

This commit is contained in:
Sean Morley 2024-07-30 08:24:22 -04:00
parent 3a01178acb
commit 30c8bea112

View file

@ -3,8 +3,17 @@
import Toast from '$lib/components/Toast.svelte';
import 'tailwindcss/tailwind.css';
export let data;
const enableAnalytics = process.env['ENABLE_ANALYTICS'] || 'false';
const unamiKey = process.env['UNAMI_KEY'] || '';
</script>
<svelte:head>
{#if enableAnalytics === 'true' && unamiKey}
<script defer src="https://cloud.umami.is/script.js" data-website-id={unamiKey}></script>
{/if}
</svelte:head>
<Navbar {data} />
<Toast />