SupremeTechnopriest/react-idle-timer

View on GitHub
docs/src/utils/ga.ts

Summary

Maintainability
A
0 mins
Test Coverage
export const pageView = (url: string) => {
  (window as any).gtag('config', process.env.GOOGLE_ANALYTICS, {
    page_path: url
  })
}

// log specific events happening.
interface IEvent {
  action: string
  params: any
}

export const event = ({ action, params }: IEvent) => {
  (window as any).gtag('event', action, params)
}