I'm trying to add react-ga to a Rails 5 API and React-Redux app. I've followed the steps outlined in the docs and events are logged in the console when debug mode is enabled, but Google Analytics isn't receiving any tracking information. I'm curious if someone here had any thoughts on the potential issue. My index.js file is included below - please note that I removed my actual UID from the code before posting here. Thanks!
client/src/index.js
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { Router, browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux'
import configureStore from './store/configureStore';
import routes from './routes';
import ReactGA from 'react-ga';
const store = configureStore();
const history = syncHistoryWithStore(browserHistory, store)
export default history;
ReactGA.initialize('MY_UID', {
debug: true,
});
function logPageView() {
ReactGA.set({ page: window.location.pathname });
ReactGA.pageview(window.location.pathname);
}
ReactDOM.render(
<Provider store={store}>
<Router routes={routes} history={history} onUpdate={logPageView}/>
</Provider>,
document.getElementById('root')
);