Spaces:
Sleeping
Sleeping
Commit
•
dd2f9fa
1
Parent(s):
e864e26
add GTM
Browse files- src/app/layout.tsx +8 -0
src/app/layout.tsx
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import type { Metadata } from 'next'
|
|
|
2 |
import { Roboto } from 'next/font/google'
|
3 |
|
4 |
import { cn } from '@/lib/utils/cn'
|
@@ -36,12 +37,19 @@ export default function RootLayout({
|
|
36 |
type="image/<generated>"
|
37 |
sizes="<generated>"
|
38 |
/>
|
|
|
|
|
|
|
|
|
|
|
39 |
</Head>
|
40 |
<body className={cn(
|
41 |
`h-full w-full overflow-auto`,
|
42 |
`dark text-neutral-100 bg-neutral-950`,
|
43 |
roboto.className
|
44 |
)}>
|
|
|
|
|
45 |
{children}
|
46 |
</body>
|
47 |
|
|
|
1 |
import type { Metadata } from 'next'
|
2 |
+
import Script from "next/script"
|
3 |
import { Roboto } from 'next/font/google'
|
4 |
|
5 |
import { cn } from '@/lib/utils/cn'
|
|
|
37 |
type="image/<generated>"
|
38 |
sizes="<generated>"
|
39 |
/>
|
40 |
+
<Script>{`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
41 |
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
42 |
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
43 |
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
44 |
+
})(window,document,'script','dataLayer','GTM-5ZGS5FDG');`}</Script>
|
45 |
</Head>
|
46 |
<body className={cn(
|
47 |
`h-full w-full overflow-auto`,
|
48 |
`dark text-neutral-100 bg-neutral-950`,
|
49 |
roboto.className
|
50 |
)}>
|
51 |
+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5ZGS5FDG"
|
52 |
+
height="0" width="0" style={{ display: "none", visibility: "hidden" }}></iframe></noscript>
|
53 |
{children}
|
54 |
</body>
|
55 |
|