Skip to content

Commit

Permalink
Merge branch 'hf-tracking' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbarne3 committed Jul 24, 2024
2 parents bccc00a + a631993 commit dc82e60
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
31 changes: 13 additions & 18 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 @@ -222,8 +208,8 @@ function App() {
const location = response.pop();

ReactGA.event({
category: "Link",
action: "link_click",
category: "link",
action: "click_internal_link",
label: `${location!.title.rendered}`,
});
html = `<a class="location-link" href="${location!.link}" onClick="{() => trackLinkClick(${location!.title.rendered}) }" target="_blank">${feature?.properties?.Name}</a>`;
Expand Down Expand Up @@ -279,8 +265,8 @@ function App() {

const campusHandler = (campus: Campus) => {
ReactGA.event({
category: "Campus Menu",
action: "campus_menu_click",
category: "campus_menu",
action: "click_campus_menu",
label: `${campus.name}`,
});

Expand All @@ -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
2 changes: 1 addition & 1 deletion src/components/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function SearchResults(props: SearchResultsProps) {

useEffect(() => {
ReactGA.event({
category: "Map Search",
category: "map_search",
action: "search",
label: `${debouncedSearchQuery}`,
});
Expand Down

0 comments on commit dc82e60

Please sign in to comment.