Setup Google Analytics to track your React.js website within minutes.

Lawrence Tan 
Aug 12, 2018 · 3 min read
npm install react-ga --save
import ReactGA from 'react-ga';
function initializeReactGA() {
ReactGA.initialize('UA-123791717-1');
ReactGA.pageview('/homepage');
}
ReactGA.event({
category: 'User',
action: 'Create an Account'
});

Google Cloud Platform - Community

A collection of technical articles published or curated by Google Cloud Platform Developer Advocates. The views expressed are those of the authors and don't necessarily reflect those of Google.

Lawrence Tan 

Written by

Mobile Application Developer @ MSD. Loves God, My Fiance, Family & Corgis. Freelance Writer when not coding.

Google Cloud Platform - Community

A collection of technical articles published or curated by Google Cloud Platform Developer Advocates. The views expressed are those of the authors and don't necessarily reflect those of Google.