first pass analytics redo

This commit is contained in:
George Powell committed 2026-09-22 12:15:56 -04:00
1 parent b656fd04c0
commit 45ffa39f2a
69 files changed
+6400 -1138

No files matched your search

+3 -1
View File
@@ -1,15 +1,17 @@
import type { PageLoad } from './$types';
import { getOrCreateAnonymousId } from '$lib/utils/analytics';
// Disable SSR so the load function runs on the client with the correct local date
export const ssr = false;
export const load: PageLoad = async ({ fetch, data }) => {
const localDate = new Date().toLocaleDateString("en-CA");
const anonymousId = getOrCreateAnonymousId();
const res = await fetch('/api/daily-verse', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ date: localDate }),
body: JSON.stringify({ date: localDate, anonymousId }),
});
const result = await res.json();