Skip to content

Commit

Permalink
feat: Add Google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Neet-Nestor committed May 17, 2024
1 parent 035feab commit eea4f3a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "./styles/markdown.scss";
import "./styles/highlight.scss";
import { getClientConfig } from "./config/client";
import { type Metadata } from "next";
import { GoogleTagManager } from "@next/third-parties/google";
import { GoogleAnalytics } from "@next/third-parties/google";

export const metadata: Metadata = {
title: "WebLLM Chat",
Expand Down Expand Up @@ -61,10 +61,8 @@ export default function RootLayout({
</head>
<body>
{children}
{process.env.GTM_ID && (
<>
<GoogleTagManager gtmId={process.env.GTM_ID} />
</>
{process.env.GOOGLE_ANALYTICS_ID && (
<GoogleAnalytics gaId={process.env.GOOGLE_ANALYTICS_ID} />
)}
</body>
</html>
Expand Down

0 comments on commit eea4f3a

Please sign in to comment.