Add minio support and forntend analitycs
This commit is contained in:
33
frontend/src/hooks/useAnalytics.ts
Normal file
33
frontend/src/hooks/useAnalytics.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import {
|
||||
trackPageView,
|
||||
trackUserAction,
|
||||
trackUserLocation,
|
||||
trackSession,
|
||||
getCurrentUserId,
|
||||
isAnalyticsEnabled
|
||||
} from '../utils/analytics';
|
||||
|
||||
/**
|
||||
* React Hook for analytics
|
||||
*
|
||||
* NOTE: Page view tracking is handled globally by initializeAnalytics() in main.tsx.
|
||||
* This hook only exposes tracking functions for use in components.
|
||||
* Do NOT add automatic page tracking here to avoid duplicate events.
|
||||
*/
|
||||
export const useAnalytics = () => {
|
||||
return {
|
||||
// Manual page view tracking (use only for custom page events, not navigation)
|
||||
trackPageView,
|
||||
// Track user actions (button clicks, form submissions, etc.)
|
||||
trackUserAction,
|
||||
// Track user location (requires consent)
|
||||
trackUserLocation,
|
||||
// Track session (typically called once at app init)
|
||||
trackSession,
|
||||
// Get current user ID
|
||||
getCurrentUserId,
|
||||
// Check if analytics are enabled
|
||||
isAnalyticsEnabled
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user