mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +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 }) {
|
export function TrackingCode({ websiteId }) {
|
||||||
const { formatMessage, messages } = useMessages();
|
const { formatMessage, messages } = useMessages();
|
||||||
const { trackerScriptName } = useConfig();
|
const { trackerScriptName } = useConfig();
|
||||||
const url = trackerScriptName.startsWith('http')
|
const url = trackerScriptName?.startsWith('http')
|
||||||
? trackerScriptName
|
? 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>`;
|
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 REPO_URL = 'https://github.com/umami-software/umami';
|
||||||
export const UPDATES_URL = 'https://api.umami.is/v1/updates';
|
export const UPDATES_URL = 'https://api.umami.is/v1/updates';
|
||||||
export const TELEMETRY_PIXEL = 'https://i.umami.is/a.png';
|
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_LOCALE = 'en-US';
|
||||||
export const DEFAULT_THEME = 'light';
|
export const DEFAULT_THEME = 'light';
|
||||||
|
Loading…
Reference in New Issue
Block a user