Script extensions

We're proud to have one of the most lightweight Javascript snippets in the analytics industry. Clocking in at less than 1KB, our script will not add any bloat to your website or cause performance issues. One of the ways we achieve that is by radically limiting the amount of options in the default script. Instead, we provide separate script files based on how you might want to use Plausible.

For example, the default plausible.js script will automatically work with pushState based frontend routing which is the most common. If your website uses hash-based routing instead, you have the option of loading the script with a different extension: plausible.hash.js. If you want to automatically track outbound links on your website, you can load plausible.outbound-links.js. And if you want both, these extensions can be combined as follows: plausible.hash.outbound-links.js.

This approach makes sure that you only load code that will actually be used on your website. Websites should not have to load dozens or hundreds of kilobytes of dead Javascript code on every pageload which degrades the user experience and causes unnecessary network traffic.

ExtensionExplanation
plausible.hash.jsAutomatically follow frontend navigation when using hash-based routing
plausible.outbound-links.jsAutomatically track clicks on outbound links from your website
plausible.exclusions.jsExclude certain pages from being tracked
plausible.compat.jsCompatibility mode for tracking users on Internet Explorer

plausible.compat.js#

The default Plausible script will not work on Internet Explorer because it uses the document.currentScript API to read configuration options. You can run Plausible in compatibility mode by including the plausible.compat.js extension and defining id="plausible" on the script tag so that it can find itself. Here's how it should look like:

<script id="plausible" defer data-domain="yourdomain.com" src="https://plausible.io/js/plausible.compat.js"></script>