Visits are counted by GoatCounter, the blog's own, as host and path: a table's code never reaches the count, and a page reached without a reload is counted too
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CCLa2PaEeCj8njQZSWGqHx
This commit is contained in:
1 parent
ee7b1d68ec
commit
6a9dc5a496
3 files changed
+16
No files matched your search
@@ -22,6 +22,11 @@
|
||||
<meta name="twitter:title" content="__NAME__" />
|
||||
<meta name="twitter:description" content="__NAME__, a game between friends, free in the browser." />
|
||||
<meta name="twitter:image" content="https://__DOMAIN__/og.png" />
|
||||
<!-- Visits are counted by GoatCounter, as host and path, with no table's code in the path. -->
|
||||
<script>
|
||||
window.goatcounter = { path: () => location.host + location.pathname.replace(/^\/join\/[^/]+/, '/join') };
|
||||
</script>
|
||||
<script data-goatcounter="https://kestrelsnest.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
<script lang="ts">
|
||||
import '../app.css';
|
||||
import { afterNavigate } from '$app/navigation';
|
||||
import Announcement from '$lib/components/Announcement.svelte';
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
// A page reached without a reload is counted as a visit too; the first load counts itself.
|
||||
afterNavigate(({ type }) => {
|
||||
if (type !== 'enter') (window as { goatcounter?: { count?: () => void } }).goatcounter?.count?.();
|
||||
});
|
||||
</script>
|
||||
|
||||
<Announcement />
|
||||
|
||||
Reference in new issue
Block a user