-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(goatcounter): properly count SPA page hits
On the surface it seems that only google and plausible scripts handle the SPA correctly - but I don't know if maybe others handle window.history API themselves somehow or something like that. However, I am trying out goatcounter and in it's docs I see that it does no special SPA handling, so this has to be added. Note: The whole `significantLoad` thing is to correctly count things - goatcounter will not be loaded and initialized yet when the initial "nav" is dispatched (because of the weird dynamic script tag insertion thing you guys have going on here), but it will count that page load when it itself is loaded. If there was a way to ensure goatcounter is loaded before the first nav, you could just configure it to not count anything on it's own load (like in their spa [example](https://www.goatcounter.com/help/spa)) and have the "nav" call it unconditionally, but that's not the case 🤷
- Loading branch information
Showing
3 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters