Only display first tracker script name.

This commit is contained in:
Mike Cao 2023-04-21 14:45:06 -07:00
parent 6c09dd1e23
commit 223f0051ed

View File

@ -7,7 +7,7 @@ export function TrackingCode({ websiteId }) {
const { trackerScriptName } = useConfig(); const { trackerScriptName } = useConfig();
const url = trackerScriptName.startsWith('http') const url = trackerScriptName.startsWith('http')
? trackerScriptName ? trackerScriptName
: `${location.origin}/${trackerScriptName}.js`; : `${location.origin}/${trackerScriptName?.split(',')?.map(n => n.trim())?.[0]}`;
const code = `<script async src="${url}" data-website-id="${websiteId}"></script>`; const code = `<script async src="${url}" data-website-id="${websiteId}"></script>`;