Skip to content

Commit 796db6f

Browse files
committed
Add Google Analytics to app
1 parent 66299be commit 796db6f

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ yarn-error.log*
2727

2828
# local env files
2929
.env*.local
30-
30+
.env
3131
# vercel
3232
.vercel
3333

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@mui/icons-material": "^5.10.9",
1515
"@mui/material": "^5.10.10",
1616
"next": "^13.0.2",
17+
"nextjs-google-analytics": "^2.2.0",
1718
"react": "18.2.0",
1819
"react-dom": "18.2.0",
1920
"react-text-typist": "1.1.0",

pages/_app.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import "src/styles/globals.scss";
22
import "src/styles/reset.scss";
33
import type { AppProps } from "next/app";
4+
import { GoogleAnalytics } from "nextjs-google-analytics";
45

56
function MyApp({ Component, pageProps }: AppProps) {
67
return (
78
<>
9+
<GoogleAnalytics trackPageViews />
810
<Component {...pageProps} />
911
</>
1012
);

yarn.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ fs.realpath@^1.0.0:
12191219
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
12201220
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
12211221

1222-
fsevents@~2.3.2:
1222+
fsevents@^2.3.2, fsevents@~2.3.2:
12231223
version "2.3.2"
12241224
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
12251225
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
@@ -1702,6 +1702,13 @@ next@^13.0.2:
17021702
"@next/swc-win32-ia32-msvc" "13.0.2"
17031703
"@next/swc-win32-x64-msvc" "13.0.2"
17041704

1705+
nextjs-google-analytics@^2.2.0:
1706+
version "2.2.0"
1707+
resolved "https://registry.yarnpkg.com/nextjs-google-analytics/-/nextjs-google-analytics-2.2.0.tgz#de81adf602dc7a0019565485a64dd2af36ca2388"
1708+
integrity sha512-UJz/nWEMnuPuEv2kwsX/4UOxZS49StvZ+GERBbtKnkHXrvL5tMIoeCzncM83Jd7GlUluoUW3KC39sAHm5JRcQQ==
1709+
optionalDependencies:
1710+
fsevents "^2.3.2"
1711+
17051712
normalize-path@^3.0.0, normalize-path@~3.0.0:
17061713
version "3.0.0"
17071714
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"

0 commit comments

Comments
 (0)