Skip to content

Commit d46454d

Browse files
committed
feat: add Google Analytics script to index.html for traffic monitoring
1 parent 4eae003 commit d46454d

File tree

3 files changed

+27
-36
lines changed

3 files changed

+27
-36
lines changed

public/index.html

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@
5050
/> -->
5151

5252
<title>NeuroJSON.io - Free Data Worth Sharing</title>
53-
<link rel="stylesheet" href="https://leeoniya.github.io/uPlot/dist/uPlot.min.css" />
53+
<link
54+
rel="stylesheet"
55+
href="https://leeoniya.github.io/uPlot/dist/uPlot.min.css"
56+
/>
5457
<style>
5558
#chartpanel {
5659
background-color: #707070;
@@ -59,13 +62,13 @@
5962
margin-top: 20px;
6063
border-radius: 10px;
6164
}
62-
65+
6366
#chartpanel h4 {
6467
padding-top: 0;
6568
margin-bottom: 10px;
6669
color: black;
6770
}
68-
71+
6972
#chartpanel a.closebtn {
7073
float: right;
7174
font-size: 28px;
@@ -74,13 +77,12 @@
7477
text-decoration: none;
7578
margin-top: -10px;
7679
}
77-
80+
7881
.uplot {
7982
margin: auto;
8083
max-width: 100%;
8184
}
8285
</style>
83-
8486
</head>
8587
<body>
8688
<noscript>You need to enable JavaScript to run this app.</noscript>
@@ -107,7 +109,23 @@
107109
<script src="%PUBLIC_URL%/js/jdata.js"></script>
108110
<script src="%PUBLIC_URL%/js/bjdata.js"></script>
109111
<script src="https://bundle.run/[email protected]"></script>
110-
<script>var buffer_module = buffer;</script>
112+
<script>
113+
var buffer_module = buffer;
114+
</script>
111115
<script src="https://leeoniya.github.io/uPlot/dist/uPlot.iife.min.js"></script>
116+
<!-- Google tag (gtag.js) -->
117+
<script
118+
async
119+
src="https://www.googletagmanager.com/gtag/js?id=G-J4WYV02Q5B"
120+
></script>
121+
<script>
122+
window.dataLayer = window.dataLayer || [];
123+
function gtag() {
124+
dataLayer.push(arguments);
125+
}
126+
gtag("js", new Date());
127+
128+
gtag("config", "G-J4WYV02Q5B");
129+
</script>
112130
</body>
113131
</html>

src/design/Layouts/FullScreen.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
1-
import { AppBar, Box, Button, Grid, Toolbar, Typography } from "@mui/material";
1+
import { Box } from "@mui/material";
22
import DefaultNavBar from "components/NavBar/DefaultNavBar";
33
import LandingNavBar from "components/NavBar/LandingNavBar";
4-
// import { Colors } from "design/theme";
5-
// import useIsLargeScreen from "hooks/useIsLargeScreen";
6-
import { useState, useEffect, useRef } from "react";
7-
import { Outlet, useNavigate, Link, useLocation } from "react-router-dom";
8-
9-
// import RoutesEnum from "types/routes.enum";
4+
import { useState, useEffect } from "react";
5+
import { Outlet, useLocation } from "react-router-dom";
106

117
const FullScreen = () => {
12-
// const isLargeScreen = useIsLargeScreen();
138
const location = useLocation();
149
const isLandingPage = location.pathname === "/";
15-
16-
// const navigate = useNavigate();
1710
const [scrolled, setScrolled] = useState(false);
1811

19-
// const justifyContentValue = isLargeScreen ? "flex-start" : "space-between";
20-
2112
useEffect(() => {
2213
const handleScroll = () => {
2314
setScrolled(window.scrollY > window.innerHeight - 100);
@@ -38,11 +29,9 @@ const FullScreen = () => {
3829
<Box
3930
sx={{
4031
width: "100%",
41-
// height: "calc(100vh - 6rem)",
4232
minHeight: "calc(100vh - 6rem)",
4333
boxSizing: "border-box",
4434
marginTop: "6rem",
45-
// backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2000 1500'%3E%3Cdefs%3E%3CradialGradient id='a' gradientUnits='objectBoundingBox'%3E%3Cstop offset='0' stop-color='%23282C56'/%3E%3Cstop offset='1' stop-color='%235865F2'/%3E%3C/radialGradient%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='0' y1='750' x2='1550' y2='750'%3E%3Cstop offset='0' stop-color='%234049a4'/%3E%3Cstop offset='1' stop-color='%235865F2'/%3E%3C/linearGradient%3E%3Cpath id='s' fill='url(%23b)' d='M1549.2 51.6c-5.4 99.1-20.2 197.6-44.2 293.6c-24.1 96-57.4 189.4-99.3 278.6c-41.9 89.2-92.4 174.1-150.3 253.3c-58 79.2-123.4 152.6-195.1 219c-71.7 66.4-149.6 125.8-232.2 177.2c-82.7 51.4-170.1 94.7-260.7 129.1c-90.6 34.4-184.4 60-279.5 76.3C192.6 1495 96.1 1502 0 1500c96.1-2.1 191.8-13.3 285.4-33.6c93.6-20.2 185-49.5 272.5-87.2c87.6-37.7 171.3-83.8 249.6-137.3c78.4-53.5 151.5-114.5 217.9-181.7c66.5-67.2 126.4-140.7 178.6-218.9c52.3-78.3 96.9-161.4 133-247.9c36.1-86.5 63.8-176.2 82.6-267.6c18.8-91.4 28.6-184.4 29.6-277.4c0.3-27.6 23.2-48.7 50.8-48.4s49.5 21.8 49.2 49.5c0 0.7 0 1.3-0.1 2L1549.2 51.6z'/%3E%3Cg id='g'%3E%3Cuse href='%23s' transform='scale(0.12) rotate(60)'/%3E%3Cuse href='%23s' transform='scale(0.2) rotate(10)'/%3E%3Cuse href='%23s' transform='scale(0.25) rotate(40)'/%3E%3Cuse href='%23s' transform='scale(0.3) rotate(-20)'/%3E%3Cuse href='%23s' transform='scale(0.4) rotate(-30)'/%3E%3Cuse href='%23s' transform='scale(0.5) rotate(20)'/%3E%3Cuse href='%23s' transform='scale(0.6) rotate(60)'/%3E%3Cuse href='%23s' transform='scale(0.7) rotate(10)'/%3E%3Cuse href='%23s' transform='scale(0.835) rotate(-40)'/%3E%3Cuse href='%23s' transform='scale(0.9) rotate(40)'/%3E%3Cuse href='%23s' transform='scale(1.05) rotate(25)'/%3E%3Cuse href='%23s' transform='scale(1.2) rotate(8)'/%3E%3Cuse href='%23s' transform='scale(1.333) rotate(-60)'/%3E%3Cuse href='%23s' transform='scale(1.45) rotate(-30)'/%3E%3Cuse href='%23s' transform='scale(1.6) rotate(10)'/%3E%3C/g%3E%3C/defs%3E%3Cg transform='translate(400 0)'%3E%3Cg %3E%3Ccircle fill='url(%23a)' r='3000'/%3E%3Cg opacity='0.5'%3E%3Ccircle fill='url(%23a)' r='2000'/%3E%3Ccircle fill='url(%23a)' r='1800'/%3E%3Ccircle fill='url(%23a)' r='1700'/%3E%3Ccircle fill='url(%23a)' r='1651'/%3E%3Ccircle fill='url(%23a)' r='1450'/%3E%3Ccircle fill='url(%23a)' r='1250'/%3E%3Ccircle fill='url(%23a)' r='1175'/%3E%3Ccircle fill='url(%23a)' r='900'/%3E%3Ccircle fill='url(%23a)' r='750'/%3E%3Ccircle fill='url(%23a)' r='500'/%3E%3Ccircle fill='url(%23a)' r='380'/%3E%3Ccircle fill='url(%23a)' r='250'/%3E%3C/g%3E%3Cg transform='rotate(-273.6 0 0)'%3E%3Cuse href='%23g' transform='rotate(10)'/%3E%3Cuse href='%23g' transform='rotate(120)'/%3E%3Cuse href='%23g' transform='rotate(240)'/%3E%3C/g%3E%3Ccircle fill-opacity='0.61' fill='url(%23a)' r='3000'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`,
4635
backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2000 1500'%3E%3Cdefs%3E%3CradialGradient id='a' gradientUnits='objectBoundingBox'%3E%3Cstop offset='0' stop-color='%23000000'/%3E%3Cstop offset='1' stop-color='%235865F2'/%3E%3C/radialGradient%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='0' y1='750' x2='1550' y2='750'%3E%3Cstop offset='0' stop-color='%232c3379'/%3E%3Cstop offset='1' stop-color='%235865F2'/%3E%3C/linearGradient%3E%3Cpath id='s' fill='url(%23b)' d='M1549.2 51.6c-5.4 99.1-20.2 197.6-44.2 293.6c-24.1 96-57.4 189.4-99.3 278.6c-41.9 89.2-92.4 174.1-150.3 253.3c-58 79.2-123.4 152.6-195.1 219c-71.7 66.4-149.6 125.8-232.2 177.2c-82.7 51.4-170.1 94.7-260.7 129.1c-90.6 34.4-184.4 60-279.5 76.3C192.6 1495 96.1 1502 0 1500c96.1-2.1 191.8-13.3 285.4-33.6c93.6-20.2 185-49.5 272.5-87.2c87.6-37.7 171.3-83.8 249.6-137.3c78.4-53.5 151.5-114.5 217.9-181.7c66.5-67.2 126.4-140.7 178.6-218.9c52.3-78.3 96.9-161.4 133-247.9c36.1-86.5 63.8-176.2 82.6-267.6c18.8-91.4 28.6-184.4 29.6-277.4c0.3-27.6 23.2-48.7 50.8-48.4s49.5 21.8 49.2 49.5c0 0.7 0 1.3-0.1 2L1549.2 51.6z'/%3E%3Cg id='g'%3E%3Cuse href='%23s' transform='scale(0.12) rotate(60)'/%3E%3Cuse href='%23s' transform='scale(0.2) rotate(10)'/%3E%3Cuse href='%23s' transform='scale(0.25) rotate(40)'/%3E%3Cuse href='%23s' transform='scale(0.3) rotate(-20)'/%3E%3Cuse href='%23s' transform='scale(0.4) rotate(-30)'/%3E%3Cuse href='%23s' transform='scale(0.5) rotate(20)'/%3E%3Cuse href='%23s' transform='scale(0.6) rotate(60)'/%3E%3Cuse href='%23s' transform='scale(0.7) rotate(10)'/%3E%3Cuse href='%23s' transform='scale(0.835) rotate(-40)'/%3E%3Cuse href='%23s' transform='scale(0.9) rotate(40)'/%3E%3Cuse href='%23s' transform='scale(1.05) rotate(25)'/%3E%3Cuse href='%23s' transform='scale(1.2) rotate(8)'/%3E%3Cuse href='%23s' transform='scale(1.333) rotate(-60)'/%3E%3Cuse href='%23s' transform='scale(1.45) rotate(-30)'/%3E%3Cuse href='%23s' transform='scale(1.6) rotate(10)'/%3E%3C/g%3E%3C/defs%3E%3Cg transform='translate(400 0)'%3E%3Cg %3E%3Ccircle fill='url(%23a)' r='3000'/%3E%3Cg opacity='0.5'%3E%3Ccircle fill='url(%23a)' r='2000'/%3E%3Ccircle fill='url(%23a)' r='1800'/%3E%3Ccircle fill='url(%23a)' r='1700'/%3E%3Ccircle fill='url(%23a)' r='1651'/%3E%3Ccircle fill='url(%23a)' r='1450'/%3E%3Ccircle fill='url(%23a)' r='1250'/%3E%3Ccircle fill='url(%23a)' r='1175'/%3E%3Ccircle fill='url(%23a)' r='900'/%3E%3Ccircle fill='url(%23a)' r='750'/%3E%3Ccircle fill='url(%23a)' r='500'/%3E%3Ccircle fill='url(%23a)' r='380'/%3E%3Ccircle fill='url(%23a)' r='250'/%3E%3C/g%3E%3Cg transform='rotate(-273.6 0 0)'%3E%3Cuse href='%23g' transform='rotate(10)'/%3E%3Cuse href='%23g' transform='rotate(120)'/%3E%3Cuse href='%23g' transform='rotate(240)'/%3E%3C/g%3E%3Ccircle fill-opacity='0.79' fill='url(%23a)' r='3000'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`,
4736
backgroundAttachment: "fixed",
4837
backgroundSize: "cover",

src/pages/SearchPage.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -141,20 +141,6 @@ const SearchPage: React.FC = () => {
141141
),
142142
};
143143

144-
// print the result in dev tool
145-
if (Array.isArray(searchResults)) {
146-
searchResults.forEach((item, idx) => {
147-
try {
148-
const parsed = JSON.parse(item.json);
149-
console.log(`Result #${idx}:`, { ...item, parsedJson: parsed });
150-
} catch (e) {
151-
console.error(`Failed to parse JSON for item #${idx}`, e);
152-
}
153-
});
154-
} else {
155-
console.warn("searchResults is not an array:", searchResults);
156-
}
157-
158144
// determine the results are subject-level or dataset-level
159145
let isDataset: boolean | null = null;
160146

@@ -268,7 +254,6 @@ const SearchPage: React.FC = () => {
268254
>
269255
<Button
270256
variant="contained"
271-
// onClick={() => document.querySelector("form")?.requestSubmit()}
272257
type="submit"
273258
form="search-form"
274259
sx={{
@@ -302,7 +287,6 @@ const SearchPage: React.FC = () => {
302287
schema={schema}
303288
onSubmit={handleSubmit}
304289
validator={validator}
305-
// liveValidate
306290
formData={formData}
307291
onChange={({ formData }) => setFormData(formData)}
308292
uiSchema={uiSchema}

0 commit comments

Comments
 (0)