Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Display custom tracker script name.
Mike Caoc7a3505c39b6
diff --git a/components/forms/TrackingCodeForm.js b/components/forms/TrackingCodeForm.jsindex fd679ab2e..bfc6940d2 100644--- a/components/forms/TrackingCodeForm.js+++ b/components/forms/TrackingCodeForm.js@@ -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>diff --git a/next.config.js b/next.config.jsindex cdeb51d75..dd8bfba05 100644--- a/next.config.js+++ b/next.config.js@@ -6,6 +6,7 @@ module.exports = {VERSION: pkg.version,FORCE_SSL: !!process.env.FORCE_SSL,DISABLE_LOGIN: !!process.env.DISABLE_LOGIN,+ TRACKER_SCRIPT_NAME: process.env.TRACKER_SCRIPT_NAME,},basePath: process.env.BASE_PATH,eslint: {