diff --git a/components/pages/settings/websites/TrackingCode.js b/components/pages/settings/websites/TrackingCode.js index 425dda06..c847ed0d 100644 --- a/components/pages/settings/websites/TrackingCode.js +++ b/components/pages/settings/websites/TrackingCode.js @@ -4,10 +4,12 @@ import useConfig from 'hooks/useConfig'; export function TrackingCode({ websiteId }) { const { formatMessage, messages } = useMessages(); - const { trackerScriptName } = useConfig(); + const { basePath, trackerScriptName } = useConfig(); const url = trackerScriptName?.startsWith('http') ? trackerScriptName - : `${location.origin}/${trackerScriptName?.split(',')?.map(n => n.trim())?.[0] || 'script.js'}`; + : `${location.origin}${basePath}/${ + trackerScriptName?.split(',')?.map(n => n.trim())?.[0] || 'script.js' + }`; const code = ``;