Skip to content

Commit

Permalink
Added tracking to a memo
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbarne3 committed Jul 24, 2024
1 parent 9ddf51d commit a631993
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,6 @@ const FOOTER_SOCIAL_ID = import.meta.env.VITE_REMOTE_SOCIAL_LINKS_ID;
const REACT_MEASUREMENT_ID = import.meta.env.VITE_REACTGA_MEASUREMENT_ID || '';

function App() {
if(REACT_MEASUREMENT_ID) {
ReactGA.initialize(REACT_MEASUREMENT_ID, {
gaOptions: {
debug_mode: true,
},
gtagOptions: {
debug_mode: true,
},
});

// Send pageview with a custom path
ReactGA.send({ hitType: "pageview", page: "/map/", title: "UCF Campus Map" });
}

const initialLng = -81.200142;
const intitalLat = 28.602368;
const initialZoom = 15;
Expand Down Expand Up @@ -303,6 +289,15 @@ function App() {
mapRef.current!.getCanvas().style.cursor = '';
}

useMemo(() => {
if ( REACT_MEASUREMENT_ID ) {
ReactGA.initialize(REACT_MEASUREMENT_ID);

// Send pageview with a custom path
ReactGA.send({ hitType: "pageview", page: "/map/", title: "UCF Campus Map" });
}
}, []);

useMemo(() => {
// Location data
fetch('data/geojson/locations/buildingPoints.geojson')
Expand Down

0 comments on commit a631993

Please sign in to comment.