|
1 | 1 | import React from "react" |
2 | 2 | import type { Metadata } from "next" |
| 3 | +import Script from "next/script" |
3 | 4 | import { Inter } from "next/font/google" |
4 | 5 | import { SEO } from "@/lib/seo" |
5 | 6 | import { ogImageUrl } from "@/lib/og" |
@@ -97,6 +98,30 @@ export default function RootLayout({ children }: { children: React.ReactNode }) |
97 | 98 | /> |
98 | 99 | </head> |
99 | 100 | <body className={inter.className}> |
| 101 | + {/* Google Tag Manager Script */} |
| 102 | + <Script |
| 103 | + id="google-tag-manager" |
| 104 | + strategy="afterInteractive" |
| 105 | + dangerouslySetInnerHTML={{ |
| 106 | + __html: ` |
| 107 | + (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': |
| 108 | + new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], |
| 109 | + j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
| 110 | + 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
| 111 | + })(window,document,'script','dataLayer','GTM-M2JZHV8N'); |
| 112 | + `, |
| 113 | + }} |
| 114 | + /> |
| 115 | + {/* Google Tag Manager (noscript) */} |
| 116 | + <noscript> |
| 117 | + <iframe |
| 118 | + src="https://www.googletagmanager.com/ns.html?id=GTM-M2JZHV8N" |
| 119 | + height="0" |
| 120 | + width="0" |
| 121 | + style={{ display: "none", visibility: "hidden" }} |
| 122 | + /> |
| 123 | + </noscript> |
| 124 | + {/* End Google Tag Manager (noscript) */} |
100 | 125 | <div itemScope itemType="https://schema.org/WebSite"> |
101 | 126 | <link itemProp="url" href={SEO.url} /> |
102 | 127 | <meta itemProp="name" content={SEO.name} /> |
|
0 commit comments