mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Display custom tracker script name.
This commit is contained in:
parent
8e350a2056
commit
c7a3505c39
2 changed files with 4 additions and 1 deletions
|
|
@ -5,6 +5,8 @@ import Button from 'components/common/Button';
|
|||
import FormLayout, { FormButtons, FormRow } from 'components/layout/FormLayout';
|
||||
import CopyButton from 'components/common/CopyButton';
|
||||
|
||||
const scriptName = process.env.TRACKER_SCRIPT_NAME || 'umami';
|
||||
|
||||
export default function TrackingCodeForm({ values, onClose }) {
|
||||
const ref = useRef();
|
||||
const { basePath } = useRouter();
|
||||
|
|
@ -24,7 +26,7 @@ export default function TrackingCodeForm({ values, onClose }) {
|
|||
rows={3}
|
||||
cols={60}
|
||||
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}/${scriptName}.js"></script>`}
|
||||
readOnly
|
||||
/>
|
||||
</FormRow>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue