Plausible Analytics Integration Plugin
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:
- 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 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.