Skip to content

Conversation

@mjsir911
Copy link
Contributor

@mjsir911 mjsir911 commented Aug 9, 2025

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):

  • Implement vhost-tracking with the javascript or tracking pixel stuff
  • do any sort of vhost filtering/searching/searching, and consequently doesn't create any new tables.

image

Additional things that need doing

  • adding tests
  • adding/updating documentation

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):

  • touch up domain link referral elision to maybe use vhost to elide referrers if they exist instead.
  • migrate all historical paths to use domainlink if it exists
    • very backwards incompatible if using a goatcounter site for multiple vhosts AND setting a single domainlink., although I can't imagine anyone doing this? Makes all the links incorrect
  • default set vhost to domainlink if vhost doesn't exist
    • Makes some assumptions about paths being uploaded without vhosts & assuming a site is for a single host if domainlink is set on that site. Which isn't a given.

@arp242
Copy link
Owner

arp242 commented Aug 11, 2025

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"?

@mjsir911
Copy link
Contributor Author

mjsir911 commented Aug 11, 2025 via email

@arp242
Copy link
Owner

arp242 commented Aug 11, 2025

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?

@mjsir911
Copy link
Contributor Author

mjsir911 commented Aug 12, 2025 via email

@mjsir911
Copy link
Contributor Author

@arp242 how do the netlify PR-domains work? can I preview this version of goatcounter on them?

@mjsir911 mjsir911 force-pushed the m/vhosts branch 2 times, most recently from e171b17 to 535ae78 Compare October 28, 2025 03:58
@mjsir911 mjsir911 force-pushed the m/vhosts branch 2 times, most recently from 54be3a8 to b8d4c8b Compare October 28, 2025 04:47
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants