Skip to content

Commit

Permalink
Analytics: Add umami for openclimbing.org (#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvaclavik authored Nov 13, 2024
1 parent 7294cc0 commit e37adb8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { GlobalStyle } from '../src/helpers/GlobalStyle';
import { doShortenerRedirect } from '../src/services/helpers';
import { PROJECT_ID, PROJECT_NAME } from '../src/services/project';
import { GoogleAnalytics } from './api/google-analytics';
import { Umami } from './api/umami';

type Props = AppProps & EmotionCacheProviderProps;

Expand Down Expand Up @@ -48,7 +49,12 @@ export default class MyApp extends App<Props> {
<GlobalStyle />
</UserThemeProvider>
</AppCacheProvider>
{isOpenClimbing && <GoogleAnalytics />}
{isOpenClimbing && (
<>
<GoogleAnalytics />
<Umami />
</>
)}
</>
);
}
Expand Down
12 changes: 12 additions & 0 deletions pages/api/umami.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import Script from 'next/script';

const UMAMI_ID = '85c41d25-1a2a-4168-9786-a442a92e6171';

export const Umami = () => (
<Script
defer
src="https://cloud.umami.is/script.js"
data-website-id={UMAMI_ID}
/>
);

0 comments on commit e37adb8

Please sign in to comment.