Skip to content

Commit

Permalink
feat: add umami track code
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0225SUN committed Feb 3, 2025
1 parent 5ab3176 commit 0f27ce9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/[lang]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'nextra-theme-docs/style.css'
import type { ReactNode } from 'react'
import { Logo } from '~/components/logo'
import '~/styles/globals.css'
import { Analytics } from '~/components/analytics'
import type { Locale } from '~/i18n/config'
import { getDictionary } from '~/i18n/routing'

Expand Down Expand Up @@ -84,6 +85,7 @@ export default async function RootLayout({
>
{children}
</Layout>
<Analytics />
</body>
</html>
)
Expand Down
14 changes: 14 additions & 0 deletions src/components/analytics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Script from 'next/script'

export const Analytics = () => {
return (
<>
{/* Umami Analytics */}
<Script
defer
src='https://umami.createwise.ai/script.js'
data-website-id='f3b98deb-8fea-4132-898a-9e2f6b220d27'
/>
</>
)
}

0 comments on commit 0f27ce9

Please sign in to comment.