Add initial support for Google Analytics
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React from 'react'
|
||||
import ReactGA from 'react-ga'
|
||||
import { Provider } from 'react-redux'
|
||||
import { createHashHistory } from 'history'
|
||||
import { Admin, Resource } from 'react-admin'
|
||||
@@ -19,9 +20,18 @@ import themeReducer from './personal/themeReducer'
|
||||
import { addToPlaylistDialogReducer } from './dialogs/dialogState'
|
||||
import createAdminStore from './store/createAdminStore'
|
||||
import { i18nProvider } from './i18n'
|
||||
import config from './config'
|
||||
|
||||
const history = createHashHistory()
|
||||
|
||||
if (config.gaTrackingId) {
|
||||
ReactGA.initialize(config.gaTrackingId)
|
||||
history.listen((location) => {
|
||||
ReactGA.pageview(location.pathname)
|
||||
})
|
||||
ReactGA.pageview(window.location.pathname)
|
||||
}
|
||||
|
||||
const App = () => (
|
||||
<Provider
|
||||
store={createAdminStore({
|
||||
|
||||
Reference in New Issue
Block a user