A React package to integrate Google Analytics easily. Please see example.js
useGoogleAnalytics(trackingId: string)
import useGoogleAnalytics from 'react-google-analytics';
const TRACKING_ID = 'YOUR_GA_TRACKING_ID';
useGoogleAnalytics(TRACKING_ID);
npm i react-google-analytics-easy