Skip to content

Commit

Permalink
feat: add custom analytics (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
maaaathis authored Oct 29, 2024
1 parent cd8f054 commit 894f87b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Rubik } from 'next/font/google';
import localFont from 'next/font/local';
import type { FC, ReactElement, ReactNode } from 'react';

import { Analytics } from '@/components/Analytics';
import Header from '@/components/Header';

import './globals.css';
Expand Down Expand Up @@ -92,6 +93,7 @@ const RootLayout: FC<RootLayoutProps> = ({ children }): ReactElement => {
</main>
</div>
</Providers>
<Analytics />
<SpeedInsights />
</body>
</html>
Expand Down
10 changes: 10 additions & 0 deletions components/Analytics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use client';

export const Analytics = () => (
<script
defer
src={process.env.NEXT_PUBLIC_ANALYTICS_SCRIPT}
data-website-id={process.env.NEXT_PUBLIC_ANALYTICS_ID}
data-domains="digga.dev"
></script>
);

1 comment on commit 894f87b

@vercel
Copy link

@vercel vercel bot commented on 894f87b Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.