Skip to content

Commit

Permalink
Merge branch 'staging' into update-nextjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Anchel123 authored Jan 8, 2025
2 parents d1902ed + 636c105 commit 3c01100
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 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;
}
9 changes: 2 additions & 7 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Toaster } from "@/components/ui/toaster";
import { cn } from "@/lib/utils";
import { Metadata } from "next";
import NextAuthProvider from "./providers";
import GoogleAnalytics from "./components/GoogleAnalytics";
import GTM from "./GTM";

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

Expand All @@ -26,12 +26,7 @@ export default function RootLayout({
return (
<html className="w-screen h-screen" lang="en" suppressHydrationWarning>
<body className={cn("h-full LandingPage", inter.className)}>
{
process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS ? (
<GoogleAnalytics ga_id=
{process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS} />
) : null
}
<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 @@ -57,6 +57,7 @@
"react-dom": "^18",
"react-dropzone": "^14.2.3",
"react-force-graph-2d": "^1.26.1",
"react-gtm-module": "^2.0.11",
"react-hook-form": "^7.49.3",
"react-json-tree": "^0.19.0",
"react-resizable-panels": "^1.0.9",
Expand All @@ -73,6 +74,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 3c01100

Please sign in to comment.