Skip to content

Commit 1bc01bc

Browse files
committed
Try google analytics
1 parent 0053e67 commit 1bc01bc

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
SENTRY_DSN='https://XXXX.ingest.sentry.io/00000000'
2+
GA_GCODE='G-XXXXXXXXXXX'

src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ require('dotenv').config();
44

55
import App from './App';
66
import { initSentry } from './shared/initSentry';
7+
import './services/GaService';
78

89
initSentry();
910

src/screens/Main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Main = () => {
1515
const location = useLocation();
1616

1717
useEffect(() => {
18-
analytics?.pageview(location.pathname);
18+
analytics?.pageview(location.pathname).event('Event', 'test').send();
1919
}, [location.pathname]);
2020

2121
return (

yarn.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10460,6 +10460,15 @@ universal-analytics@^0.4.23:
1046010460
request "^2.88.2"
1046110461
uuid "^3.0.0"
1046210462

10463+
universal-analytics@0.4.23:
10464+
version "0.4.23"
10465+
resolved "https://registry.yarnpkg.com/universal-analytics/-/universal-analytics-0.4.23.tgz#d915e676850c25c4156762471bdd7cf2eaaca8ac"
10466+
integrity sha512-lgMIH7XBI6OgYn1woDEmxhGdj8yDefMKg7GkWdeATAlQZFrMrNyxSkpDzY57iY0/6fdlzTbBV03OawvvzG+q7A==
10467+
dependencies:
10468+
debug "^4.1.1"
10469+
request "^2.88.2"
10470+
uuid "^3.0.0"
10471+
1046310472
universalify@^0.1.0:
1046410473
version "0.1.2"
1046510474
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"

0 commit comments

Comments
 (0)