From 8d5337f071894bc5d84d48fea539e6b22dc5a0eb Mon Sep 17 00:00:00 2001 From: SnowCait Date: Tue, 10 Oct 2023 18:30:56 +0900 Subject: [PATCH] Google Analytics --- web/src/app.html | 1 + web/src/routes/parts/Gdpr.svelte | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/web/src/app.html b/web/src/app.html index e96e65e00..9e35096e3 100644 --- a/web/src/app.html +++ b/web/src/app.html @@ -29,6 +29,7 @@ document.documentElement.classList.add('dark'); } +
%sveltekit.body%
diff --git a/web/src/routes/parts/Gdpr.svelte b/web/src/routes/parts/Gdpr.svelte index c3a3615af..5c4c36650 100644 --- a/web/src/routes/parts/Gdpr.svelte +++ b/web/src/routes/parts/Gdpr.svelte @@ -19,10 +19,15 @@ }; function initAnalytics() { - console.log('[analytics init]'); + console.debug('[analytics init]'); + + window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + + gtag('config', 'G-G1WMSV0PBP'); } -