feat(analytics): support new plausible script (#587)
Some checks failed
Build Site / Check and Build for Pull Requests (push) Has been cancelled
Build Site / Build and Deploy on Main Push (push) Has been cancelled

Co-authored-by: welpo <welpo@users.noreply.github.com>
This commit is contained in:
Christian F. Coors 2026-02-03 17:31:00 +01:00 committed by GitHub
parent d73e64032b
commit e04ed249d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 34 additions and 9 deletions

View file

@ -0,0 +1,12 @@
// Initialise Plausible analytics queue for the new script format (v3.1.0+).
// This sets up a queue system that collects tracking calls before the main
// Plausible script loads, ensuring no events are lost.
window.plausible = window.plausible || function () {
(plausible.q = plausible.q || []).push(arguments);
};
// Initialise the Plausible configuration object.
plausible.init = plausible.init || function (config) {
plausible.o = config || {};
};
// Set up Plausible with default configuration.
plausible.init();