declare global { interface Window { gtag : any ; } } export const pageview = ( url ) : void => { window . gtag ( 'config' , process . env . NEXT_PUBLIC_GA_TRACKING , { page_path : url } ) ; } ; type Event = { action : string ; category : string ; label : string ; value ? : string ; } ; export const gaEvent = ( { action , category , label , value } ) : void => { window . gtag ( 'event' , action , { event_category : category , event_label : label , value : value } ) ; } ;