fix: analytics
This commit is contained in:
@@ -66,7 +66,11 @@ export class UmamiAnalyticsService implements AnalyticsService {
|
||||
const payload = {
|
||||
website: this.websiteId,
|
||||
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:
|
||||
typeof window !== "undefined"
|
||||
? `${window.screen.width}x${window.screen.height}`
|
||||
@@ -131,7 +135,9 @@ export class UmamiAnalyticsService implements AnalyticsService {
|
||||
url:
|
||||
typeof window !== "undefined"
|
||||
? 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 ||
|
||||
(typeof window !== "undefined"
|
||||
? window.location.pathname + window.location.search
|
||||
: undefined),
|
||||
: this.serverContext?.referrer
|
||||
? new URL(this.serverContext.referrer).pathname
|
||||
: "/"),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user