fix: analytics

This commit is contained in:
2026-02-10 00:15:36 +01:00
parent 8f39ec3d35
commit 40ebdb31d9

View File

@@ -66,7 +66,11 @@ export class UmamiAnalyticsService implements AnalyticsService {
const payload = { const payload = {
website: this.websiteId, website: this.websiteId,
hostname: hostname:
typeof window !== "undefined" ? window.location.hostname : "server", typeof window !== "undefined"
? window.location.hostname
: this.serverContext?.referrer
? new URL(this.serverContext.referrer).hostname
: "server",
screen: screen:
typeof window !== "undefined" typeof window !== "undefined"
? `${window.screen.width}x${window.screen.height}` ? `${window.screen.width}x${window.screen.height}`
@@ -131,7 +135,9 @@ export class UmamiAnalyticsService implements AnalyticsService {
url: url:
typeof window !== "undefined" typeof window !== "undefined"
? window.location.pathname + window.location.search ? window.location.pathname + window.location.search
: undefined, : this.serverContext?.referrer
? new URL(this.serverContext.referrer).pathname
: "/",
}); });
} }
@@ -144,7 +150,9 @@ export class UmamiAnalyticsService implements AnalyticsService {
url || url ||
(typeof window !== "undefined" (typeof window !== "undefined"
? window.location.pathname + window.location.search ? window.location.pathname + window.location.search
: undefined), : this.serverContext?.referrer
? new URL(this.serverContext.referrer).pathname
: "/"),
}); });
} }
} }