diff --git a/components/pages/settings/websites/TrackingCode.js b/components/pages/settings/websites/TrackingCode.js index fc2e5e68..425dda06 100644 --- a/components/pages/settings/websites/TrackingCode.js +++ b/components/pages/settings/websites/TrackingCode.js @@ -5,9 +5,9 @@ import useConfig from 'hooks/useConfig'; export function TrackingCode({ websiteId }) { const { formatMessage, messages } = useMessages(); const { trackerScriptName } = useConfig(); - const url = trackerScriptName.startsWith('http') + const url = trackerScriptName?.startsWith('http') ? trackerScriptName - : `${location.origin}/${trackerScriptName?.split(',')?.map(n => n.trim())?.[0]}`; + : `${location.origin}/${trackerScriptName?.split(',')?.map(n => n.trim())?.[0] || 'script.js'}`; const code = ``; diff --git a/lib/constants.ts b/lib/constants.ts index 9b16fc55..425d729f 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -12,7 +12,6 @@ export const HOMEPAGE_URL = 'https://umami.is'; export const REPO_URL = 'https://github.com/umami-software/umami'; export const UPDATES_URL = 'https://api.umami.is/v1/updates'; export const TELEMETRY_PIXEL = 'https://i.umami.is/a.png'; -export const TRACKER_SCRIPT_URL = '/script.js'; export const DEFAULT_LOCALE = 'en-US'; export const DEFAULT_THEME = 'light';