Skip to content

Commit

Permalink
add GTM
Browse files Browse the repository at this point in the history
  • Loading branch information
Naseem77 committed Feb 23, 2025
1 parent f2b0069 commit 9abd8da
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ui/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;
}
2 changes: 2 additions & 0 deletions ui/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from "next";
import "./globals.css";
import { Toaster } from "@/components/ui/toaster";
import GTM from "./GTM";

export const metadata: Metadata = {
title: "Benchmark by FalkorDB",
Expand All @@ -15,6 +16,7 @@ export default function RootLayout({
return (
<html lang="en">
<body>
<GTM />
{children}
<Toaster />
</body>
Expand Down
15 changes: 15 additions & 0 deletions ui/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 ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"react": "^19.0.0",
"react-chartjs-2": "^5.3.0",
"react-dom": "^19.0.0",
"react-gtm-module": "^2.0.11",
"react-icons": "^5.4.0",
"react-resizable-panels": "^2.1.7",
"tailwind-merge": "^2.6.0",
Expand All @@ -44,6 +45,7 @@
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/react-gtm-module": "^2.0.4",
"eslint": "^9",
"eslint-config-next": "15.1.3",
"postcss": "^8.4.49",
Expand Down

0 comments on commit 9abd8da

Please sign in to comment.