gtm added
This commit is contained in:
parent
8b254a8867
commit
febcc7b8ad
@ -1,11 +1,4 @@
|
|||||||
import { poppins } from "@/lib/font";
|
import { poppins } from "@/lib/font";
|
||||||
// import dynamic from "next/dynamic";
|
|
||||||
|
|
||||||
// // Lazy load heavy components
|
|
||||||
// const ContactFloat = dynamic(() => import("@/components/ContactFloat"), { ssr: false });
|
|
||||||
// const AutoPopup = dynamic(() => import("@/components/AutoPopup"), { ssr: false });
|
|
||||||
|
|
||||||
// Import only necessary CSS for global layout
|
|
||||||
import "@/node_modules/react-modal-video/css/modal-video.css";
|
import "@/node_modules/react-modal-video/css/modal-video.css";
|
||||||
import "../public/assets/css/bootstrap.css";
|
import "../public/assets/css/bootstrap.css";
|
||||||
import "../public/assets/css/color.css";
|
import "../public/assets/css/color.css";
|
||||||
@ -13,7 +6,7 @@ import "../public/assets/css/style.css";
|
|||||||
import "swiper/css";
|
import "swiper/css";
|
||||||
import "swiper/css/pagination";
|
import "swiper/css/pagination";
|
||||||
import "swiper/css/free-mode";
|
import "swiper/css/free-mode";
|
||||||
import Head from "next/head";
|
import Script from "next/script";
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: "Best Pain Relief & Physiotherapy - Repharehab Clinic",
|
title: "Best Pain Relief & Physiotherapy - Repharehab Clinic",
|
||||||
@ -23,46 +16,47 @@ export const metadata = {
|
|||||||
export default function RootLayout({ children }) {
|
export default function RootLayout({ children }) {
|
||||||
return (
|
return (
|
||||||
<html lang="en" className={`${poppins.variable}`}>
|
<html lang="en" className={`${poppins.variable}`}>
|
||||||
<Head>
|
<head>
|
||||||
{/* Lazy load non-critical CSS */}
|
{/* Microsoft Clarity */}
|
||||||
<link
|
<Script id="clarity-script" strategy="afterInteractive">
|
||||||
rel="stylesheet"
|
{`
|
||||||
href="/assets/css/style.css"
|
|
||||||
media="print"
|
|
||||||
onLoad="this.media='all'"
|
|
||||||
/>
|
|
||||||
<link
|
|
||||||
rel="stylesheet"
|
|
||||||
href="/assets/css/swiper.css"
|
|
||||||
media="print"
|
|
||||||
onLoad="this.media='all'"
|
|
||||||
/>
|
|
||||||
<link
|
|
||||||
rel="stylesheet"
|
|
||||||
href="/assets/css/swiper-pagination.css"
|
|
||||||
media="print"
|
|
||||||
onLoad="this.media='all'"
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Microsoft Clarity Tracking */}
|
|
||||||
<script
|
|
||||||
dangerouslySetInnerHTML={{
|
|
||||||
__html: `
|
|
||||||
(function(c,l,a,r,i,t,y){
|
(function(c,l,a,r,i,t,y){
|
||||||
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
||||||
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/th7p0lr1ca";
|
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/th7p0lr1ca";
|
||||||
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
||||||
})(window, document, "clarity", "script", "th7p0lr1ca");
|
})(window, document, "clarity", "script", "th7p0lr1ca");
|
||||||
`,
|
`}
|
||||||
}}
|
</Script>
|
||||||
/>
|
|
||||||
</Head>
|
|
||||||
<body>
|
|
||||||
{children}
|
|
||||||
|
|
||||||
{/* Lazy loaded components */}
|
{/* Google Tag Manager */}
|
||||||
{/* <ContactFloat /> */}
|
<Script id="gtm-init" strategy="afterInteractive">
|
||||||
{/* <AutoPopup /> */}
|
{`
|
||||||
|
(function(w,d,s,l,i){
|
||||||
|
w[l]=w[l]||[];
|
||||||
|
w[l].push({'gtm.start': new Date().getTime(), event:'gtm.js'});
|
||||||
|
var f=d.getElementsByTagName(s)[0],
|
||||||
|
j=d.createElement(s),
|
||||||
|
dl=l!='dataLayer'?'&l='+l:'';
|
||||||
|
j.async=true;
|
||||||
|
j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;
|
||||||
|
f.parentNode.insertBefore(j,f);
|
||||||
|
})(window,document,'script','dataLayer','G-KM1KJW539N');
|
||||||
|
`}
|
||||||
|
</Script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
{/* GTM noscript fallback */}
|
||||||
|
<noscript>
|
||||||
|
<iframe
|
||||||
|
src="https://www.googletagmanager.com/ns.html?id=G-KM1KJW539N"
|
||||||
|
height="0"
|
||||||
|
width="0"
|
||||||
|
style={{ display: "none", visibility: "hidden" }}
|
||||||
|
></iframe>
|
||||||
|
</noscript>
|
||||||
|
|
||||||
|
{children}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user