Anton Bulakh
2025-02-27 6d350500f1bdadc9604ece5980dafa02150dd849
refs
author Anton Bulakh <him@necauq.ua>
Thursday, February 27, 2025 21:35 +0000
committer GitHub <noreply@github.com>
Thursday, February 27, 2025 21:35 +0000
commit6d350500f1bdadc9604ece5980dafa02150dd849
tree 76068746059c0b99356d08e18a2efe1bbf8bfb82 tree | zip | gz
parent 9b47279fe62bfd8921bb4f98c3008feff2d9fe34 view | diff
fix(goatcounter): properly count SPA page hits (#1718)

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 fixed.

Just doing the dynamic script thing on every nav seems to do the trick.
The script is not "spa-preserve" so they wouldn't accumulate - and when
I tried the "spa-preserve" + call goatcounter api route it didn't quite
work, they actually did accumulate
1 files modified
14 ■■■■■ changed files
quartz/plugins/emitters/componentResources.ts 14 ●●●●● diff | view | raw | blame | history