mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 10:05:36 +01:00
Pass analyticsUrl prop.
This commit is contained in:
parent
7f1f3b685a
commit
a3a24e76c9
3 changed files with 12 additions and 8 deletions
|
|
@ -3,7 +3,7 @@ import useMessages from 'components/hooks/useMessages';
|
|||
import useConfig from 'components/hooks/useConfig';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
export function TrackingCode({ websiteId, baseUrl }) {
|
||||
export function TrackingCode({ websiteId, analyticsUrl }) {
|
||||
const { formatMessage, messages } = useMessages();
|
||||
const { basePath } = useRouter();
|
||||
const config = useConfig();
|
||||
|
|
@ -13,7 +13,7 @@ export function TrackingCode({ websiteId, baseUrl }) {
|
|||
|
||||
const url = trackerScriptName?.startsWith('http')
|
||||
? trackerScriptName
|
||||
: `${baseUrl || location.origin}${basePath}/${trackerScriptName}`;
|
||||
: `${analyticsUrl || location.origin}${basePath}/${trackerScriptName}`;
|
||||
|
||||
const code = `<script async src="${url}" data-website-id="${websiteId}"></script>`;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue