File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ const PageTracker = () => {
4747const App = ( ) => {
4848 useEffect ( ( ) => {
4949 initGA ( ) ;
50+ console . log ( "init" ) ;
5051 } , [ ] ) ;
5152
5253 return (
Original file line number Diff line number Diff line change @@ -5,13 +5,17 @@ const GA_MEASUREMENT_ID = import.meta.env.VITE_GA_MEASUREMENT_ID || "";
55const isProduction = import . meta. env . MODE === "production" ;
66
77const initGA = ( ) => {
8+ console . log ( "isProduction" , isProduction ) ;
9+ console . log ( "ID" , GA_MEASUREMENT_ID ) ;
810 if ( isProduction && GA_MEASUREMENT_ID ) {
911 ReactGA . initialize ( GA_MEASUREMENT_ID ) ;
1012 }
1113} ;
1214
1315const trackPageView = ( path : string ) => {
16+ console . log ( "trackPageView 1" ) ;
1417 if ( isProduction && GA_MEASUREMENT_ID ) {
18+ console . log ( "trackPageView 2" ) ;
1519 ReactGA . send ( { hitType : "pageview" , page : path } ) ;
1620 }
1721} ;
You can’t perform that action at this time.
0 commit comments