File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom/client'
33import * as Sentry from '@sentry/react'
44import App from './App.tsx'
55import './index.css'
6+ import { loadUmamiScript } from './utils/analytics'
67
78// Initialize Sentry for error tracking
89// Only initialize if DSN is provided (production environment) AND user hasn't explicitly declined
@@ -80,6 +81,14 @@ if (import.meta.env.VITE_SENTRY_DSN && errorReportingConsent !== 'declined') {
8081 } ) ;
8182}
8283
84+ // Initialize analytics if user has consented
85+ const analyticsConsent = localStorage . getItem ( 'lenr-analytics-consent' )
86+ if ( analyticsConsent === 'accepted' ) {
87+ loadUmamiScript ( ) . catch ( error => {
88+ console . error ( '[Analytics] Failed to load on startup:' , error )
89+ } )
90+ }
91+
8392ReactDOM . createRoot ( document . getElementById ( 'root' ) ! ) . render (
8493 < React . StrictMode >
8594 < App />
You can’t perform that action at this time.
0 commit comments