File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Google Analytics (gtag) loader
2+
3+ ( function ( ) {
4+ const GA_ID = 'G-LF96D9G25P' ; // Update this with your Google Analytics ID
5+
6+ const script = document . createElement ( 'script' ) ;
7+ script . async = true ;
8+ script . src = `https://www.googletagmanager.com/gtag/js?id=${ GA_ID } ` ;
9+ document . head . appendChild ( script ) ;
10+
11+ window . dataLayer = window . dataLayer || [ ] ;
12+ function gtag ( ) {
13+ window . dataLayer . push ( arguments ) ;
14+ }
15+ window . gtag = gtag ;
16+
17+ gtag ( 'js' , new Date ( ) ) ;
18+ gtag ( 'config' , GA_ID ) ;
19+ } ) ( ) ;
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ const isAbout = pageTitle === 'About';
4545 document.documentElement.classList.remove('dark');
4646 }
4747 </script >
48+ <script
49+ is:inline
50+ type =' text/partytown'
51+ src =' ../analytics/google-analytics.js' ></script >
4852 </head >
4953 <body class =' flex min-h-screen flex-col pt-16 bg-white dark:bg-dark-bg' >
5054 <Header pageTitle ={ pageTitle } />
You can’t perform that action at this time.
0 commit comments