Skip to content

Commit

Permalink
feat: use ga and clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
chunsch committed May 9, 2024
1 parent 22445b7 commit ab8389d
Show file tree
Hide file tree
Showing 3 changed files with 1,411 additions and 1,090 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"url": "git+https://github.com/sunnylife42/docs.git"
},
"license": "CC BY-NC 4.0",
"homepage": "https://sunnylife.love/docs",
"homepage": "https://sunnylife42.com/",
"dependencies": {
"@next/third-parties": "^14.2.3",
"next": "^13.1.6",
"next-plausible": "^3.7.2",
"nextra": "latest",
"nextra-theme-docs": "latest",
"react": "^18.2.0",
Expand Down
24 changes: 17 additions & 7 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import type { AppProps } from 'next/app';
import type Viewer from 'viewerjs';
import { useEffect } from 'react';
import { useRouter } from 'next/router';
import PlausibleProvider from 'next-plausible';
import Script from 'next/script';
import { GoogleTagManager } from '@next/third-parties/google';
import 'viewerjs/dist/viewer.css';
import '../styles/global.css';

let viewer: Viewer;
const isProduction = process.env.NODE_ENV === 'production';

const initViewer = () => {
const el = document.getElementById('main');
Expand Down Expand Up @@ -51,13 +53,21 @@ function App({ Component, pageProps }: AppProps) {
}, [events]);

return (
<PlausibleProvider
selfHosted
domain="sunnylife42.com"
customDomain="https://analytics.cyc.app"
>
<>
<Component {...pageProps} />
</PlausibleProvider>
{isProduction && (
<>
<GoogleTagManager gtmId="G-BT21DSH0MG" />
<Script id="ms-clarity">
{`(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", "m9402dwuco");`}
</Script>
</>
)}
</>
);
}

Expand Down
Loading

0 comments on commit ab8389d

Please sign in to comment.