tabi icon indicating copy to clipboard operation
tabi copied to clipboard

Support new Plausible script

Open ccoors opened this issue 5 months ago • 0 comments

Summary and motivation

In #193 support for Plausible was added. In Plausible 3.1.0 the script was updated. While the legacy script still works, support for the new script should be added as well.

The update looks like this:

-<script defer data-domain="example.com" src="https://plausible.example.com.de/js/script.js"></script>
+<script async src="https://plausible.example.com/js/pa-<random script name>.js"></script>
+<script>
+window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
+plausible.init()
+</script>

Implementation details

Maybe add something like plausible_modern as a new service in [extra.analytics] and reuse id for the random script name instead of the site name to support both styles of scripts?

Checklist

  • [x] I've searched existing issues to make sure this feature hasn't already been requested.
  • [x] This feature aligns with tabi's philosophy (minimal JS, accessible…)
  • [x] I'm willing to contribute to the implementation of this feature.

ccoors avatar Nov 14 '25 16:11 ccoors