Last active
September 4, 2019 23:51
-
-
Save hiro08gh/698b4228611b40f27bfb9681d21d66ec to your computer and use it in GitHub Desktop.
外部サービスの各種設定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { render } from 'react-dom'; | |
import { Router } from 'react-router-dom'; | |
import ReactGA from 'react-ga'; | |
import {hotjar} from 'react-hotjar'; | |
import * as Sentry from '@sentry/browser'; | |
import App from './App'; | |
const { NODE_ENV } = process.env; | |
if (NODE_ENV === 'production') { | |
//google analyticsの初期設定 | |
ReactGA.initialize(process.env.GOOGLE_ANALYTICS_SECRET); | |
history.listen(({ pathname }) => { | |
ReactGA.set({ page: pathname }); | |
ReactGA.pageview(pathname); | |
}); | |
//ravenの初期設定 | |
Sentry.init({ dsn: process.env.RAVEN_SECRET }); | |
// hotjarの設定(任意) | |
hotjar.initialize('242424', 7); | |
} | |
render( | |
<Router history={history}> | |
<App /> | |
</Router>, | |
document.getElementById('root'), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment