mirror of
https://github.com/zoo-labs/zoo.git
synced 2026-11-10 22:32:34 +00:00
20 lines
507 B
TypeScript
20 lines
507 B
TypeScript
import ReactGA from 'react-ga'
|
|
|
|
export const logPageView = () => {
|
|
// console.log(`Logging pageview for ${window.location.pathname}`)
|
|
ReactGA.set({ page: window.location.pathname })
|
|
ReactGA.pageview(window.location.pathname)
|
|
}
|
|
|
|
export const logEvent = (category = '', action = '') => {
|
|
if (category && action) {
|
|
ReactGA.event({ category, action })
|
|
}
|
|
}
|
|
|
|
export const logException = (description = '', fatal = false) => {
|
|
if (description) {
|
|
ReactGA.exception({ description, fatal })
|
|
}
|
|
}
|