Plausible Analytics Integration Plugin

Plausible is an open-source, privacy-focused analytics solution that provides in-depth information on your site traffic and user behavior. Unlike other analytical solutions, Plausible doesn't use cookies of any kind; this means that it doesn't collect any identifiable user data and doesn't require GDPR-consent from your site visitors. With this plugin, you can integrate Plausible analytics code into your Publii website automatically without the need to modify your site files manually.

Creating a Plausible Account

Before enabling this plugin, make sure that you have created an account with Plausible and added your domain to your account; without an active account, no data can be collected by Plausible.

A full guide to signing-up with Plausible can be found in their documentation. Make a note of the domain that you entered when adding your website to Plausible, as this will need to be entered into the plugin settings in Publii.

Enabling the Plugin

To activate the plugin, open the Tools & Plugins section of the Publii app via the left-menu to see a list of installed plugins. Click on the switcher button in the bottom-left of the Plausible Analytics Integration box in this list to enable the plugin.

You'll need to add some information to the plugin before it can function properly, so now click on the plugin box to open the Plugin Options screen.

Plausible Analytics Integration Options

Plausible is very simple to use, so only one option in this section is required; Domain; the other options can be enabled as and if you need them:

Configuration

  • Domain - Enter the domain that you will be tracking through Plausible Analytics here; make sure it is the same domain as entered when adding your website to your Plausible account.
  • Script URL - This option allows you to enter the URL to point to the self-hosted plausible.js file. By default or when empty it will always link to the plausible.io domain (https://plausible.io/js/plausible.js)
  • Output Code in Preview Mode - Enabling this option will add Plausible analytics code to your site when opening a preview, which can be useful for debugging. Generally, this option should not be enabled as it may affect the accuracy of the tracking data that is sent to Plausible.

Cookie Banner Integration

  • Cookie Banner Integration - Enabling this option will add an option to the built-in Publii cookie banner for users to consent to cookies from Plausible. Currently, Plausible requires no consent as it does not use cookies, but this option has been added should you be using a modified setup or advanced function that uses cookies in some manner.
  • Cookie Group ID - This option only becomes available when the Cookie Banner Integration option is enabled. Here, you can specify the cookie group that the Plausible Analytics cookies should be added to, e.g. 'analitics'. Make sure to add (if it doesn't exist) this group name to the GDPR section of the site settings. You can find instructions on how to do this in the GDPR section of this documentation.