Skip to content

armgit / umami

Public Imported from GitHub
0

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.

Remove www from domain.

Mike Cao8276a769e682
diff --git a/pages/api/send.ts b/pages/api/send.ts
index 05901f920..51ddb9805 100644
--- a/pages/api/send.ts
+++ b/pages/api/send.ts
@@ -121,7 +121,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
const refUrl = new URL(referrer);
referrerPath = refUrl.pathname;
referrerQuery = refUrl.search.substring(1);
- referrerDomain = refUrl.hostname;
+ referrerDomain = refUrl.hostname.replace(/www\./, '');
}
if (process.env.REMOVE_TRAILING_SLASH) {