11import React from "react"
22import type { Metadata } from "next"
33import { Inter } from "next/font/google"
4+ import Script from "next/script"
45
56import { Providers } from "@/components/providers"
67
@@ -45,17 +46,6 @@ export default function RootLayout({ children }: { children: React.ReactNode })
4546 return (
4647 < html lang = "en" suppressHydrationWarning >
4748 < head >
48- { /* Google Tag Manager */ }
49- < script
50- dangerouslySetInnerHTML = { {
51- __html : `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
52- new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
53- j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
54- 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
55- })(window,document,'script','dataLayer','GTM-M2JZHV8N');` ,
56- } }
57- />
58- { /* End Google Tag Manager */ }
5949 < link
6050 rel = "stylesheet"
6151 type = "text/css"
@@ -79,6 +69,19 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
7969 < Providers >
8070 < Shell > { children } </ Shell >
8171 </ Providers >
72+ { /* Google Tag Manager */ }
73+ < Script
74+ id = "google-tag-manager"
75+ strategy = "afterInteractive"
76+ dangerouslySetInnerHTML = { {
77+ __html : `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
78+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
79+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
80+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
81+ })(window,document,'script','dataLayer','GTM-M2JZHV8N');` ,
82+ } }
83+ />
84+ { /* End Google Tag Manager */ }
8285 </ body >
8386 </ html >
8487 )
0 commit comments