Skip to content

Commit

Permalink
feat/vercel-analytics
Browse files Browse the repository at this point in the history
feat: add vercel analytics
  • Loading branch information
rikhall1515 authored Apr 18, 2024
2 parents f36ba3f + 4fe346e commit acf41aa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Analytics } from "@vercel/analytics/react";
import { SpeedInsights } from "@vercel/speed-insights/next";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";

import { VERCEL_ENV } from "@/next.constants.mjs";
const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
Expand All @@ -16,7 +19,15 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={inter.className}>
{children}
{VERCEL_ENV && (
<>
<Analytics />
<SpeedInsights />
</>
)}
</body>
</html>
);
}

0 comments on commit acf41aa

Please sign in to comment.