diff --git a/app/layout.tsx b/app/layout.tsx index d047a338..9eb58a9c 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,9 +1,9 @@ +import Analytics from '../components/head/Analytics'; import GoogleTagManagerScript from '../components/head/GoogleTagManagerScript'; import ErrorBoundary from '../components/layout/ErrorBoundary'; import rootMetadata from './rootMetadata'; import RollbarScript from '../components/head/RollbarScript'; import ThemeRegistry from './ThemeRegistry'; -import rootMetadata from './rootMetadata'; export const metadata = rootMetadata; @@ -26,6 +26,7 @@ export default function RootLayout({ {children} + ); diff --git a/components/head/Analytics.tsx b/components/head/Analytics.tsx new file mode 100644 index 00000000..ac86d261 --- /dev/null +++ b/components/head/Analytics.tsx @@ -0,0 +1,13 @@ +import { Analytics as VercelAnalytics } from '@vercel/analytics/react'; +import { Hotjar } from 'nextjs-hotjar'; + +export default function Analytics() { + return ( + <> + {!!process.env.NEXT_PUBLIC_HOTJAR_ID && process.env.NEXT_PUBLIC_ENV !== 'local' && ( + + )} + + + ); +}