Skip to content

Commit f8c2ebc

Browse files
committed
fix: add google tag manager for analytics [skip ci]
Signed-off-by: sarthakjdev <jsarthak448@gmail.com>
1 parent c2c45d4 commit f8c2ebc

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

apps/wapijs.co/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@microsoft/api-extractor-model": "^7.28.14",
1515
"@microsoft/tsdoc": "^0.14.2",
1616
"@microsoft/tsdoc-config": "^0.16.2",
17+
"@next/third-parties": "^14.2.3",
1718
"@react-icons/all-files": "^4.1.0",
1819
"@shikijs/rehype": "^1.4.0",
1920
"@tailwindcss/typography": "^0.5.10",

apps/wapijs.co/src/app/layout.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Inter } from 'next/font/google'
33
import './globals.css'
44
import 'overlayscrollbars/overlayscrollbars.css'
55
import { clsx } from 'clsx'
6+
import { GoogleTagManager } from '@next/third-parties/google'
7+
import { IS_PRODUCTION } from '~/constant'
68

79
const inter = Inter({ subsets: ['latin'] })
810

@@ -17,6 +19,11 @@ export default function RootLayout({
1719
}>) {
1820
return (
1921
<html lang="en">
22+
{IS_PRODUCTION ? (
23+
<>
24+
<GoogleTagManager gtmId={'GTM-PSX33PK2'} />
25+
</>
26+
) : null}
2027
<body className={clsx(inter.className, 'min-h-screen bg-[#121212]')}>{children}</body>
2128
</html>
2229
)

pnpm-lock.yaml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)