Skip to content

Commit 8ad181d

Browse files
committed
update analytics
1 parent 4657cf0 commit 8ad181d

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/root.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ interface LayoutProps {
3737
children: React.ReactNode;
3838
}
3939

40+
function Analytics() {
41+
return (
42+
<>
43+
{/* Privacy-friendly analytics by Plausible */}
44+
<script
45+
async
46+
src="https://analytics.mit.edu/js/pa-gQ_B0WWR0n8I3ly4S-urO.js"
47+
></script>
48+
<script>
49+
{`window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
50+
plausible.init()`}
51+
</script>
52+
</>
53+
);
54+
}
55+
4056
export const Layout = withEmotionCache((props: LayoutProps, cache) => {
4157
const { children } = props;
4258

@@ -50,11 +66,7 @@ export const Layout = withEmotionCache((props: LayoutProps, cache) => {
5066
<title>Hydrant</title>
5167
<Meta />
5268
<Links />
53-
<script
54-
defer
55-
data-domain="hydrant.mit.edu"
56-
src="https://analytics.mit.edu/js/script.hash.outbound-links.tagged-events.js"
57-
></script>
69+
<Analytics />
5870
</head>
5971
<body>
6072
<Provider>

0 commit comments

Comments
 (0)