File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 < link rel ="icon " type ="image/svg+xml " href ="/vite.svg " />
66 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
77 < title > QPython+ - Personalized Programming Learning Community</ title >
8+ <!-- Google tag (gtag.js) -->
9+ < script async src ="https://www.googletagmanager.com/gtag/js?id=G-JH6WGHX4M2 "> </ script >
10+ < script >
11+ window . dataLayer = window . dataLayer || [ ] ;
12+ function gtag ( ) { dataLayer . push ( arguments ) ; }
13+ gtag ( 'js' , new Date ( ) ) ;
14+ gtag ( 'config' , 'G-JH6WGHX4M2' ) ;
15+ </ script >
816 </ head >
917 < body >
1018 < div id ="root "> </ div >
Original file line number Diff line number Diff line change @@ -291,6 +291,12 @@ export function CoursesPage() {
291291 rel = "noopener noreferrer"
292292 className = "block bg-white rounded-lg shadow-lg overflow-hidden hover:shadow-xl transition-shadow"
293293 onClick = { ( e ) => {
294+ if ( typeof window . gtag !== 'undefined' ) {
295+ window . gtag ( 'event' , 'select_content' , {
296+ content_type : 'course' ,
297+ item_id : course . id ,
298+ } )
299+ }
294300 if ( typeof window !== 'undefined' && ( window as any ) . milib ) {
295301 e . preventDefault ( )
296302 ; ( window as any ) . milib . openUrl ( course . url )
Original file line number Diff line number Diff line change 1+ interface Window {
2+ gtag : ( ...args : any [ ] ) => void
3+ }
You can’t perform that action at this time.
0 commit comments