Skip to content

Commit 7c44f5b

Browse files
committed
fix: revert GA4 tracking from GTM to direct script
1 parent a97d980 commit 7c44f5b

1 file changed

Lines changed: 9 additions & 20 deletions

File tree

src/app/layout.tsx

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -102,28 +102,17 @@ export default function RootLayout({
102102
/>
103103
<head>
104104
<Script
105-
id="google-tag-manager"
106-
strategy="afterInteractive"
107-
dangerouslySetInnerHTML={{
108-
__html: `
109-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
110-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
111-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
112-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
113-
})(window,document,'script','dataLayer','GTM-P32GFLD5');
114-
`,
115-
}}
116-
/>
105+
async
106+
src="https://www.googletagmanager.com/gtag/js?id=G-J5CD036GJP"
107+
></Script>
108+
<Script id="google-analytics">
109+
{`window.dataLayer = window.dataLayer || [];
110+
function gtag(){dataLayer.push(arguments);}
111+
gtag('js', new Date());
112+
gtag('config', 'G-J5CD036GJP');`}
113+
</Script>
117114
</head>
118115
<body>
119-
<noscript>
120-
<iframe
121-
src={`https://www.googletagmanager.com/ns.html?id=GTM-P32GFLD5`}
122-
height="0"
123-
width="0"
124-
style={{display: 'none', visibility: 'hidden'}}
125-
/>
126-
</noscript>
127116
<ThemeProvider
128117
attribute="class"
129118
defaultTheme="dark"

0 commit comments

Comments
 (0)