diff --git a/app/website/index.html b/app/website/index.html index 0b677f0..745d91f 100644 --- a/app/website/index.html +++ b/app/website/index.html @@ -18,38 +18,17 @@ href="https://fonts.googleapis.com/css2?family=Lexend+Zetta:wght@900&display=swap" rel="stylesheet" /> - - - -
- - - + - console.log('Google Analytics initialized for:', address); - + +
+ diff --git a/app/website/public/ga.js b/app/website/public/ga.js new file mode 100644 index 0000000..963dced --- /dev/null +++ b/app/website/public/ga.js @@ -0,0 +1,24 @@ +/* eslint-disable */ + +function analytics() { + const validAddressTerms = ['github', 'beefchimi', 'earwurm']; + const address = window.location.href.toLowerCase(); + const validAddress = validAddressTerms.every((term) => + address.includes(term), + ); + + if (!validAddress) return; + + window.dataLayer = window.dataLayer || []; + + function gtag() { + dataLayer.push(arguments); + } + + gtag('js', new Date()); + gtag('config', 'G-4CCVV95VKM'); + + console.log('Google Analytics initialized for:', address); +} + +analytics();