Repository navigation
Best way to tell subdomains apart in one website? #4641
Replies: 1 comment
|
For thousands of subdomains belonging to the same site, I would keep one website and preserve the real path plus the separate hostname. Your workaround is accepted as a path, but changes the meaning of the stored page data. Looking at the v3.4.0 collection handler:
I would send: hostname: location.hostname,
url: location.pathname + location.search,and use the hostname filter you already found when inspecting Pages. A If you need all |
Uh oh!
There was an error while loading. Please reload this page.
Hi, and thanks for Umami!
Setup
We run one self-hosted Umami website (v3.4.0) for a site with a very large number of subdomains. We send page views ourselves with a small
fetchto/api/send(no tracker script, no cookies) to keep the pages lightweight.What we noticed
In the Pages report only the path is shown, so
/onwww.example.comand/on any subdomain look identical. The hostname is stored with every event and can be used as a filter (and there is a Hostname view), but it is not visible in the Pages list.Our workaround
We prefix the hostname to the URL we send:
So the same page shows up as
/subdomain-a.example.com/instead of/.Questions
urlan acceptable approach, or does it have downsides we are not seeing (e.g. for sessions, entry/exit pages, UTM handling, referrer filtering)?tagfor this? (I read in subdomain support for multi-tenant application #897 that the website ID is what matters and the domain field is only used to filter referrers.)Thanks for any advice!
All reactions