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:
parent
3a01178acb
commit
30c8bea112
1 changed files with 9 additions and 0 deletions
|
@ -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 />
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue