initial
This commit is contained in:
10
web/lib/analytics.ts
Normal file
10
web/lib/analytics.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export const track = (event: string, params: Record<string, any> = {}) => {
|
||||
if (typeof window !== 'undefined' && (window as any).gtag) {
|
||||
(window as any).gtag('event', event, params);
|
||||
}
|
||||
|
||||
// Also log to console in development
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log('Analytics event:', event, params);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user