Skip to content

Commit a7130e9

Browse files
Added Script for analytics
1 parent bf18248 commit a7130e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/app/layout.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import '@/styles/globals.css';
2+
import Script from 'next/script';
23
import type { Metadata, Viewport } from 'next';
34
import { Space_Grotesk } from 'next/font/google';
45
import { Toaster } from 'react-hot-toast';
@@ -23,6 +24,11 @@ export default function RootLayout({ children }: React.PropsWithChildren) {
2324
<ReportModal />
2425
</SessionProvider>
2526
<Toaster position="bottom-right" />
27+
{process.env.NEXT_PUBLIC_ANALYTICS_WEBSITE_ID && <Script
28+
src="https://cloud.umami.is/script.js"
29+
data-website-id={process.env.NEXT_PUBLIC_ANALYTICS_WEBSITE_ID}
30+
strategy="lazyOnLoad"
31+
/>}
2632
</body>
2733
</html>
2834
);

0 commit comments

Comments
 (0)