Skip to content

Commit

Permalink
Merge branch 'staging' into restyle-browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Anchel123 committed Jan 8, 2025
2 parents 92a039b + 636c105 commit 048ebdc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
15 changes: 15 additions & 0 deletions app/GTM.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"use client"

import { useEffect } from "react";
import TagManager from "react-gtm-module";

export default function GTM() {
useEffect(() => {
const gtmId = process.env.NEXT_PUBLIC_GTM_ID
if (gtmId) {
TagManager.initialize({ gtmId });
}
}, []);

return null;
}
12 changes: 4 additions & 8 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { Inter } from "next/font/google";
import { Toaster } from "@/components/ui/toaster";
import { Metadata } from "next";
import NextAuthProvider from "./providers";
import GoogleAnalytics from "./components/GoogleAnalytics";
import GTM from "./GTM";
import { cn } from "@/lib/utils";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -24,13 +25,8 @@ export default function RootLayout({
// caused by mismatched client/server content caused by next-themes
return (
<html className="w-screen h-screen" lang="en" suppressHydrationWarning>
<body className={`h-full LandingPage ${inter.className}`}>
{
process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS ? (
<GoogleAnalytics ga_id=
{process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS} />
) : null
}
<body className={cn("h-full LandingPage", inter.className)}>
<GTM />
<NextAuthProvider>{children}</NextAuthProvider>
<Toaster />
</body>
Expand Down
13 changes: 13 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"react-dropzone": "^14.2.3",
"react-force-graph-2d": "^1.26.1",
"react-hook-form": "^7.54.2",
"react-gtm-module": "^2.0.11",
"react-json-tree": "^0.19.0",
"react-resizable-panels": "^1.0.9",
"redis": "^4.6.14",
Expand All @@ -79,6 +80,7 @@
"@types/react": "^18",
"@types/react-cytoscapejs": "^1.2.5",
"@types/react-dom": "^18",
"@types/react-gtm-module": "^2.0.4",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"eslint": "^8.56.0",
Expand Down

0 comments on commit 048ebdc

Please sign in to comment.