Closed shafy closed 3 years ago
I think your workaround is good. With #160 you'll be able to send all analytics to one plausible dashboard and then split the data by subdomain in the dashboard itself.
A simple fix for now would be to default the domain
to window.location.host
if it's not specified on the script. However, we are planning to move to a numeric site ID in the future and this approach would not work with that.
Ok makes sense to me. Out of curiousity: What's the advantage of using a site ID (or using the data-domain
attribute) vs. defaulting to window.location.host
?
storage cost. The events
and sessions
tables are massive and they will only keep growing. Currently we're storing all stats against a domain
string.
Strings take up much more space than numbers. Since the site ID is static we can assign numbers to them and store it that way to reduce storage requirements quite significantly. The simplest way to do this is to move to <script data-site-id="<numeric-id">
and pass that through to the database.
Smart, thanks for explaining. Closing this issue :-)
Is your feature request related to a problem? Please describe. I have Webflow site and subdomains for different languages (e.g. de.example.com and en.example.com). However, I can't put different header codes for these subdomains. I tried adding two Plausible tags with both data-domain values, but then it only registers visits for the first one. Currently I'm solving it like this:
There are probably also other workaround.
How would you like it to work It would be great if we either could define more than one data-domain in the script tag or that the data-domain attribute is not needed at all (e.g. Simple Analytics doesn't require it). Of course, this could also be solved with the subdomain aggregation (I know that this is in works #160 )