Skip to content

Instantly share code, notes, and snippets.

@hiro08gh
Last active September 4, 2019 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiro08gh/698b4228611b40f27bfb9681d21d66ec to your computer and use it in GitHub Desktop.
Save hiro08gh/698b4228611b40f27bfb9681d21d66ec to your computer and use it in GitHub Desktop.
外部サービスの各種設定
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