Ravindra commited on
Commit
1c59b83
·
verified ·
1 Parent(s): 0237893

add ga tag in layout.tsx

Browse files
Files changed (1) hide show
  1. web/app/layout.tsx +15 -2
web/app/layout.tsx CHANGED
@@ -1,4 +1,5 @@
1
  import type { Metadata } from "next";
 
2
  import { Geist, Geist_Mono } from "next/font/google";
3
  import { Providers } from "@/components/Providers";
4
  import "./globals.css";
@@ -25,7 +26,6 @@ export const metadata: Metadata = {
25
  },
26
  };
27
 
28
-
29
  export default function RootLayout({
30
  children,
31
  }: Readonly<{
@@ -36,8 +36,21 @@ export default function RootLayout({
36
  <body
37
  className={`${geistSans.variable} ${geistMono.variable} antialiased`}
38
  >
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  <Providers>{children}</Providers>
40
  </body>
41
  </html>
42
  );
43
- }
 
1
  import type { Metadata } from "next";
2
+ import Script from "next/script";
3
  import { Geist, Geist_Mono } from "next/font/google";
4
  import { Providers } from "@/components/Providers";
5
  import "./globals.css";
 
26
  },
27
  };
28
 
 
29
  export default function RootLayout({
30
  children,
31
  }: Readonly<{
 
36
  <body
37
  className={`${geistSans.variable} ${geistMono.variable} antialiased`}
38
  >
39
+ <Script
40
+ async
41
+ src="https://www.googletagmanager.com/gtag/js?id=G-5SRFDZE7LM"
42
+ strategy="afterInteractive"
43
+ />
44
+ <Script id="ga-init" strategy="afterInteractive">
45
+ {`
46
+ window.dataLayer = window.dataLayer || [];
47
+ function gtag(){dataLayer.push(arguments);}
48
+ gtag('js', new Date());
49
+ gtag('config', 'G-5SRFDZE7LM');
50
+ `}
51
+ </Script>
52
  <Providers>{children}</Providers>
53
  </body>
54
  </html>
55
  );
56
+ }