Skip to content

Commit

Permalink
Merge pull request #4 from Angramme/dev
Browse files Browse the repository at this point in the history
fix metrics again
  • Loading branch information
Angramme authored Apr 27, 2024
2 parents f67d097 + 955d539 commit 5f3bc44
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
18 changes: 13 additions & 5 deletions components/metrics/MicrosoftClarity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
import Script from "next/script"

export const MicrosoftClarity = () => {
return <Script id="clarity-script" strategy="afterInteractive">
{`(function(c,l,a,r,i,t,y){
return <script type="text/javascript" dangerouslySetInnerHTML={{
__html: `(function(c,l,a,r,i,t,y){
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/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "m1q5zx2fms");
`}
</Script>
})(window, document, "clarity", "script", "m1q5zx2fms");`
}}>
</script>
// return <Script id="clarity-script" strategy="afterInteractive">
// {`(function(c,l,a,r,i,t,y){
// 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/"+i;
// y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
// })(window, document, "clarity", "script", "m1q5zx2fms");
// `}
// </Script>
// return <Script
// id="microsoft-clarity-init"
// strategy="afterInteractive"
Expand Down
5 changes: 3 additions & 2 deletions pages/_document.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import { MicrosoftClarity } from "../components/metrics/MicrosoftClarity";
export default function Document(){
return (
<Html lang='en'>
<Head/>
<Head>
<MicrosoftClarity/>
</Head>
<body>
<Main/>
<NextScript/>
<CloudflareAnalytics/>
<MicrosoftClarity/>
</body>
</Html>
)
Expand Down

0 comments on commit 5f3bc44

Please sign in to comment.