Skip to content

Commit e19ff85

Browse files
committed
Add analytics
1 parent ee065c2 commit e19ff85

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

package-lock.json

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"lint:fix": "npm run lint -- --fix"
1212
},
1313
"dependencies": {
14+
"@happykit/analytics": "^1.0.1",
1415
"clsx": "^1.1.1",
1516
"lite-vimeo-embed": "^0.1.0",
1617
"lite-youtube-embed": "^0.1.2",

pages/_app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useEffect } from 'react';
22
import { MDXProvider } from '@mdx-js/react';
33
import Head from 'next/head';
44
import { DefaultSeo } from 'next-seo';
5+
import { useAnalytics } from '@happykit/analytics';
56

67
import Footer from '@/components/footer';
78
import Header from '@/components/header';
@@ -14,6 +15,7 @@ import '@/styles/custom.css';
1415
import '@/styles/prism.css';
1516

1617
const MyApp = ({ Component, pageProps, router }) => {
18+
useAnalytics({ publicKey: 'analytics_pub_bba22bdbcd' });
1719
useEffect(() => {
1820
const handleRouteChange = () => {
1921
window.scrollTo({

0 commit comments

Comments
 (0)