Skip to content

Commit 82a0781

Browse files
committed
add clarity
1 parent 8edb708 commit 82a0781

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

app/layout.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { BottomBlurOverlay } from "./ui/BlurBottomOverlay"
1212
import { LazySplashCursor } from "./utils/lazy-splash-cursor"
1313
import { DesktopCursor } from "./utils/lazy-dot-cursor"
1414
import { breadcrumbSchema, contactPageSchema, profilePageSchema } from "@/config/schemas"
15+
import Script from "next/script"
1516

1617
const switzer = localFont({
1718
src: "./fonts/Switzer-Variable.woff2",
@@ -63,7 +64,26 @@ const RootLayout = ({ children }: { children: React.ReactNode }) => {
6364
<FooterV2 />
6465
</div>
6566
</MotionWrapper>
66-
{process.env.NODE_ENV === "production" && <Analytics />}
67+
{process.env.NODE_ENV === "production" && (
68+
<>
69+
<Script
70+
id="ms-clarity"
71+
strategy="lazyOnload"
72+
dangerouslySetInnerHTML={{
73+
__html: `
74+
(function(c,l,a,r,i,t,y){
75+
// bail if something polluted window.clarity
76+
if (c[a] && typeof c[a] !== "function") { try { delete c[a]; } catch(_) {} }
77+
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
78+
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
79+
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
80+
})(window, document, "clarity", "script", "t4bi2igt7h");
81+
`,
82+
}}
83+
/>
84+
<Analytics />
85+
</>
86+
)}
6787
</body>
6888
</html>
6989
)

0 commit comments

Comments
 (0)