mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01:00
Fix tracking code form.
This commit is contained in:
parent
a2bce7ae2c
commit
987e3aabbd
@ -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 = `<script async src="${url}" data-website-id="${websiteId}"></script>`;
|
||||
|
||||
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user