diff --git a/.env.default b/.env.default index 0a4b9471a0415c22c1347bc91fa77d6d5c3674a8..8407bf87fa198d717ba46d0e637d787adde9647d 100644 --- a/.env.default +++ b/.env.default @@ -5,3 +5,4 @@ ENVIRONMENT REACT_APP_BLOCLINK_URL REACT_APP_MAILCHIMP_URL REACT_APP_BLOCPOWER_CONTACT +REACT_APP_ENVIRONMENT diff --git a/src/App.js b/src/App.js index f2ce82797d2e822ff82ad6b761b40c30376d290d..7042bbe759e18bd960cead18fb541b231f12d103 100644 --- a/src/App.js +++ b/src/App.js @@ -592,7 +592,12 @@ class App extends React.Component { }; } - componentDidMount() { } + componentDidMount() { + if(process.env.REACT_APP_ENVIRONMENT==='production'){ + ReactGA.initialize('UA-67611405-11'); + ReactGA.pageview('/intake'); + } + } nextQuestion = (question, answer, value) => { const questionAnswers = {}; @@ -862,9 +867,6 @@ class App extends React.Component { } render() { - ReactGA.initialize('UA-67611405-11'); - ReactGA.pageview('/intake'); - const building = this.props.building; // const questions = this.props.questions; const contact = this.props.contact;