Skip to content

Commit 1490d6d

Browse files
committed
feat: add google analytic
1 parent 83d6575 commit 1490d6d

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"prettier": "^3.2.5",
5050
"react": "^18.0.0",
5151
"react-dom": "^18.0.0",
52+
"react-ga-neo": "^2.2.0",
5253
"react-hook-form": "^7.33.1",
5354
"react-markdown": "^8.0.5",
5455
"react-rating": "^2.0.5",

src/main.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { withSuspensable } from 'components/Suspensable'
1414
import { ViewPage } from 'pages/view'
1515
import { clearOutdatedSwrCache } from 'utils/swr'
1616

17+
import ReactGA from "react-ga-neo"
18+
1719
import { App } from './App'
1820
import { AppLayout } from './layouts/AppLayout'
1921
import { NotFoundPage } from './pages/404'
@@ -39,6 +41,8 @@ Sentry.init({
3941
},
4042
})
4143

44+
ReactGA.initialize("G-K3MCHSLB5K")
45+
4246
// add platform class to root element
4347
if (navigator.userAgent.includes('Win')) {
4448
document.documentElement.classList.add('platform--windows')

yarn.lock

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4706,6 +4706,11 @@ react-fast-compare@^3.0.1:
47064706
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49"
47074707
integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==
47084708

4709+
react-ga-neo@^2.2.0:
4710+
version "2.2.0"
4711+
resolved "https://registry.npmmirror.com/react-ga-neo/-/react-ga-neo-2.2.0.tgz#3e06940ebf580f7d4e480d59e4478e26fe9f7f6c"
4712+
integrity sha512-VgJaF1Ykf/EFpmQwdsTOxHYFQDzMupa70r2pCnVLC848P06RIW6Uri8/tf2sPKI5m5EAvpBBakB5uVXEtkgoVg==
4713+
47094714
react-hook-form@^7.33.1:
47104715
version "7.33.1"
47114716
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.33.1.tgz#8c4410e3420788d3b804d62cc4c142915c2e46d0"
@@ -5278,8 +5283,16 @@ stacktrace-js@^2.0.2:
52785283
stack-generator "^2.0.5"
52795284
stacktrace-gps "^3.0.4"
52805285

5281-
"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.3:
5282-
name string-width-cjs
5286+
"string-width-cjs@npm:string-width@^4.2.0":
5287+
version "4.2.3"
5288+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
5289+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
5290+
dependencies:
5291+
emoji-regex "^8.0.0"
5292+
is-fullwidth-code-point "^3.0.0"
5293+
strip-ansi "^6.0.1"
5294+
5295+
"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.3:
52835296
version "4.2.3"
52845297
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
52855298
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -5346,7 +5359,14 @@ string_decoder@^1.1.1:
53465359
dependencies:
53475360
safe-buffer "~5.2.0"
53485361

5349-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
5362+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
5363+
version "6.0.1"
5364+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
5365+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
5366+
dependencies:
5367+
ansi-regex "^5.0.1"
5368+
5369+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
53505370
version "6.0.1"
53515371
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
53525372
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==

0 commit comments

Comments
 (0)