Skip to content

Commit

Permalink
Add analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton committed Feb 6, 2024
1 parent bff39ea commit b7aff74
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "./styles/tailwind.css"
import { GoogleAnalytics } from "@next/third-parties/google"
import { Metadata } from "next"
import { Rubik } from "next/font/google"
import { siteMeta } from "./lib/siteMeta"
Expand Down Expand Up @@ -48,6 +49,10 @@ export default function RootLayout({ children }: RootLayoutProps) {
<body className="relative flex min-h-full flex-col bg-white transition-colors duration-300 dark:bg-zinc-900">
<Providers>{children}</Providers>
</body>

{process.env.NEXT_PUBLIC_GA_ID ? (
<GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GA_ID} />
) : null}
</html>
)
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@mskelton/rehype-shiki": "^0.3.0",
"@mskelton/remark-extract-frontmatter": "^0.0.2",
"@next/mdx": "^13.5.6",
"@next/third-parties": "^14.1.0",
"@octokit/rest": "^20.0.2",
"@prisma/client": "^5.5.1",
"@tailwindcss/container-queries": "^0.1.1",
Expand Down
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b7aff74

Please sign in to comment.