We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff8c970 commit 009dd88Copy full SHA for 009dd88
src/App.jsx
@@ -1,6 +1,18 @@
1
-import React from 'react'
+import React, { useEffect } from 'react'
2
+import ReactGA from 'react-ga'
3
-import { Home } from './components/pages/Home'
4
+import { Config } from './config'
5
+import { Home } from './pages/Home'
6
7
-export const App = () => <Home />
8
+export const App = () => {
9
+
10
+ useEffect(() => {
11
+ if (process.env.NODE_ENV === 'production') {
12
+ ReactGA.initialize(Config.GoogleAnalytics)
13
+ ReactGA.pageview('/')
14
+ }
15
+ }, [])
16
17
+ return <Home />
18
+}
src/config.js
@@ -0,0 +1,3 @@
+export const Config = {
+ GoogleAnalytics: 'UA-136307971-1',
0 commit comments