From 55e91d56596e008548710755932b30f1675e4ff4 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Thu, 18 May 2023 17:26:52 +0900 Subject: [PATCH] Fix to add basePath to trackingCode generation --- components/pages/settings/websites/TrackingCode.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 = ``;