-
-
Notifications
You must be signed in to change notification settings - Fork 245
Add per-vhost hitcounts/paths #833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The way GoatCounter has always done "vhosts" is by creating separate sites that share the same users. I'm not sure it's a good idea to add a second layer of "vhosts" on top of that to be honest. Adding the ability to select which sites to display in the widget settings might be better? Simply allowing selecting the site to display for "Pages" should be fairly easy, and you can then add a second widget for the second site. Displaying multiple sites in one overview might be a bit harder. There's also some logical issues here – what to display for "totals", "Browsers", or "Referrers"? |
|
The way GoatCounter has always done "vhosts" is by creating separate sites that share the same users. I'm not sure it's a good idea to add a second layer of "vhosts" on top of that to be honest.
Alright, sure. Would you be amenable to any of the following then:
- updating the vhosts faq documentation to remove "maybe we'll implement this one day"
- allow rejecting any hits uploaded via api that have a vhost, on a site that has a domainlink set where the vhost and domainlink don't match
- alternatively, allow the goatcounter cli to programmatically upload to different sites depending on the vhost value.
- work on tooling to spin off multiple goatcounter imports filtering and uploading to and creating different sites automatically.
There are *currently* some issues with assuming all uploaded hits are underneath a single vhost.
- Links generated on the hitcounts in the UI go to nonexistent places.
- Colliding paths get combined into one hitcount (incorrectly).
If goatcounter is assuming that 1 site per vhost, is there anything that can be done to enforce/flag these assumptions?
It will be a bit inconvenient for me to set up arbitrary sites and arbitrary scrapers for whatever domains pop up on my reverse proxy, but this is workable since my understanding is the API provides arbitrary site creation & the log importer does currently allow vhost filtering.
Adding the ability to select which sites to display in the widget settings might be better? Simply allowing selecting the site to display for "Pages" should be fairly easy, and you can then add a second widget for the second site. Displaying multiple sites in one overview might be a bit harder. There's also some logical issues here – what to display for "totals", "Browsers", or "Referrers"?
I'm not at my computer right now but i can pursue this/see what you're talking about in a bit.
|
|
Right; so what you want isn't so much viewing multiple sites/domains on a single dashboard, but rather importing arbitrary domains from logfiles without having to set up any site for it first? |
|
Aug 11, 2025 11:47:38 AM Martin Tournoij ***@***.***>:
[Image]*arp242* left a comment (arp242/goatcounter#833)[#833 (comment)]
Right; so what you want isn't so much viewing multiple sites/domains on a single dashboard, but rather importing arbitrary domains from logfiles without having to set up any sites for it?
—
Reply to this email directly, view it on GitHub[#833 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AEDDZQSE7AIVMHWYBX7GMED3NDQLVAVCNFSM6AAAAACDQFYB32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNZWGM2TEMBUHE].
You are receiving this because you authored the thread.
[Tracking image][https://github.com/notifications/beacon/AEDDZQWOOFDOHI7TUZERRNL3NDQLVA5CNFSM6AAAAACDQFYB32WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTV5KNETC.gif]
Correct, yeah. This PR does as much and handles that import relatively sanely.
|
|
@arp242 how do the netlify PR-domains work? can I preview this version of goatcounter on them? |
e171b17 to
535ae78
Compare
54be3a8 to
b8d4c8b
Compare
This is not currently backwards compatible for users who imports logs via combined-vhosts or something similar, it will differentiate between paths/hits from before this patch & migration as different from paths/hits after this change if vhost is sent on log imports. Maybe we default to domainlink vhost if none is found? This makes things less backwards compatible too, then makes all new imports be different hitcounts than old ones. Maybe we retroactively patch paths that match to have a new vhost? What this doesn't do/doesn't do yet: - send vhost with the javascript or tracking pixel - migrate existing hitcounts/paths to tag the domainlink as host - allow specifying multiple domainlinks to special-case referrers
This PR is not made to have fully-comprehensive vhost support but designed to be as unobtrusively backwards compatible as possible (although not fully so unfortunately)
Things this PR intentionally doesn't do (these can be spun off into new issues):
Additional things that need doing
Questions I have about interest in implementation before pursing it / can change behaviour in a less backward compatible way (these can all spin off into separate issues if out of scope of this PR):