mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01:00
Show custom tracker script name.
This commit is contained in:
parent
9b7e472410
commit
8aa9941ca7
@ -4,10 +4,12 @@ import { useRouter } from 'next/router';
|
|||||||
import Button from 'components/common/Button';
|
import Button from 'components/common/Button';
|
||||||
import FormLayout, { FormButtons, FormRow } from 'components/layout/FormLayout';
|
import FormLayout, { FormButtons, FormRow } from 'components/layout/FormLayout';
|
||||||
import CopyButton from 'components/common/CopyButton';
|
import CopyButton from 'components/common/CopyButton';
|
||||||
|
import useConfig from 'hooks/useConfig';
|
||||||
|
|
||||||
export default function TrackingCodeForm({ values, onClose }) {
|
export default function TrackingCodeForm({ values, onClose }) {
|
||||||
const ref = useRef();
|
const ref = useRef();
|
||||||
const { basePath } = useRouter();
|
const { basePath } = useRouter();
|
||||||
|
const { trackerScriptName } = useConfig();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormLayout>
|
<FormLayout>
|
||||||
@ -24,7 +26,9 @@ export default function TrackingCodeForm({ values, onClose }) {
|
|||||||
rows={3}
|
rows={3}
|
||||||
cols={60}
|
cols={60}
|
||||||
spellCheck={false}
|
spellCheck={false}
|
||||||
defaultValue={`<script async defer data-website-id="${values.website_uuid}" src="${document.location.origin}${basePath}/umami.js"></script>`}
|
defaultValue={`<script async defer data-website-id="${values.website_uuid}" src="${
|
||||||
|
document.location.origin
|
||||||
|
}${basePath}/${trackerScriptName ? `${trackerScriptName}.js` : 'umami.js'}"></script>`}
|
||||||
readOnly
|
readOnly
|
||||||
/>
|
/>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
|
Loading…
Reference in New Issue
Block a user