Download

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)
  • Enable 404 tracking: Enable this option to specifically track 404 error pages, enhancing your capability to analyze visitor behavior and page performance.
  • 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.

Note on Enabling 404 Error Page Tracking

When you enable the option to track 404 error pages, additional setup is required on your Plausible Analytics account to capture these events.

  1. Set Up a Custom Event Goal: Navigate to the settings of the specific website you are tracking within your Plausible Analytics account and go to the "Goals" section. There, you'll find an option to define a new goal.
  2. Initiate Goal Creation: Click the "+ Add goal" button, which will take you to the goal creation form.
  3. Configure Goal Trigger: Choose "Custom event" as the trigger type and input the name "404" to specifically track 404 error pages.
  4. Complete Goal Setup: Click the "Add goal" button to finalize the process. You'll be redirected to the Goals section where you can confirm the goal has been added.

Once this is configured, tracking of 404 error pages will initiate. These will appear in the "Goal Conversions" section of your Plausible Analytics dashboard. The goal named "404" will be visible as soon as the first 404 error page is visited.

To dive deeper into the data, click on the "404" goal. This will provide a detailed list of visits to all tracked 404 error pages. From this data, you can ascertain how users are encountering broken links, enabling you to take corrective actions accordingly.

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.

What are you waiting for?

Start building your site today.

  1. 1 Download Publii
  2. 2 Write your content
  3. 3 Publish your site
Create website