Skip to content

Commit

Permalink
Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowCait committed Oct 10, 2023
1 parent 3a5dff0 commit 8d5337f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions web/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
document.documentElement.classList.add('dark');
}
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-G1WMSV0PBP"></script>
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
Expand Down
9 changes: 7 additions & 2 deletions web/src/routes/parts/Gdpr.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
</script>

<GdprBanner
cookieName="beyonk_gdpr"
heading={$_('gdpr.heading')}
Expand Down

0 comments on commit 8d5337f

Please sign in to comment.