Skip to content

Commit 74395c5

Browse files
author
Sadanand Pai
committed
Web: Analytics integration
1 parent 21359e6 commit 74395c5

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

web/src/pages/_document.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
import { Head, Html, Main, NextScript } from "next/document";
22

3+
import Script from "next/script";
4+
35
export default function Document() {
46
return (
57
<Html lang="en">
6-
<Head />
8+
<Head>
9+
<Script
10+
strategy="afterInteractive"
11+
dangerouslySetInnerHTML={{
12+
__html: `(function(c,l,a,r,i,t,y){
13+
if (window.location.hostname !== 'localhost' && window.location.hostname !== '127.0.0.1') {
14+
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
15+
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
16+
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
17+
}
18+
})(window, document, "clarity", "script", "iwnh67o45k");`,
19+
}}
20+
/>
21+
</Head>
722
<body>
823
<Main />
924
<NextScript />

0 commit comments

Comments
 (0)