An alternative, smaller script and associated proxy for Plausible Analytics
AGPL-3.0 License
An alternative, smaller script and associated proxy for Plausible Analytics.
An official hosted instance is not and will not be provided, since it will most likely be swiftly blocked.
To build your own script, simply clone this repository, install the dependencies, and run the build
script. The resulting script will be in dist/script.js
. Host it somewhere.
Then, include the usual HTML snippet in your website:
<script async defer src="https://tenable.example.com/script.js"></script>
To configure the script to use a different event API endpoint or a different domain, set the data-api
and data-domain
attributes on the script element. This behavior largely replicates the upstream script, except for the fact that data-domain
defaults to the hostname of the current page.
Other than providing a rewritten script, this project also includes a Cloudflare Worker that provides a proxy to work around domain blocks of the Plausible event API. Set up a Cloudflare account and run wrangler deploy
in this project to deploy.
When using the script from the Cloudflare Worker, the default API endpoint is changed from plausible.io
to the domain that the script is being hosted on automatically. You do not need to set the data-api
attribute manually.
data-domain
so that for the simplest setup zero configuration is requiredlocalStorage
flag support (Plausible's primary recommendation has changed to using an ad-blocker)Tenable supports none of the ten official script extensions at the moment, but that may change in the future.
AGPL 3.0