RockAnalytics by bernhard

Module to easily include plausible dashboard into the PW backend


Integrate plausible analytics or umami into your ProcessWire backend



  1. Install the module
  2. Setup plausible analytics (either self hosted or paid cloud)
  3. Copy the tracking code into your site's markup
  4. Copy the share URL to your module's config








About plausible analytics

Plausible is a "simple and privacy-friendly Google Analytics alternative". It is open source and you can either self host it or buy one of their hosted services. A live demo of their dashboard and its features can be found here:


Tracking Snippet

Tracking Snippet with Opt-Out Feature

GDPR allows collecting anonymous usage data without consent, but you need to provide an opt-out link on your privacy page. RockAnalytics comes with TextformatterRockAnalytics that will automatically render the necessary JS code to toggle tracking by the user (saved in localstorage).

It will turn this:


...into that:


Simply add [rockanalytics-toggle] to any textfield and apply the TextformatterRockAnalytics Textformatter. You can customise the rendered text (in every installed language) in the module's settings.

If you render the plausible script via the dedicated render() method RockAnalytics will only load the tracking script if the user did not opt out from tracking:

// in your main markup file
echo $modules->get('RockAnalytics')->render([
  'domain' => $config->httpHost, // see description on next section
  'src' => '',
  'onlyGuests' => true, // only load script for guest users

Manual Snippet

The recommended way is to use the dynamic snippet above! This section is kept for reference

When you add a website to your plausible dashboard it will show you a tracking code that you can paste into your site that you want to track. This is what I use to make sure that we only track users on the live site (not on local development) and only logged in users:

if(!$user->isLoggedin()) {
  $src = "";
  echo "<script defer data-domain='{$config->httpHost}' src='$src'></script>";

Providing a dynamic domain is handy because during development you can add a second website to your dashboard and see if everything works without messing up data of your live site account.

Example: We want to track the site "", so we add this site to our plausible dashboard. Then we add the snippet with the dynamic domain attribute. On local development we have the host "" so all visits will not show up in the plausible dashboard for; Now we add another website to plausible with the domain "" and voila - we will see our dev-websites' visitors in realtime.


Backend Menu Item

By default RockAnalytics will create a menu item at the top level of your backend menu, but you can move that page to any place you like. For example you could move the analytics page under the "setup" page at the top of the screenshot. You can also rename the page if you don't like the label "Analytics".


Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Latest news

  • ProcessWire Weekly #523
    In the 523rd issue of ProcessWire Weekly we'll check out what's new in the core this week, share some new module related news, and more. Read on! / 18 May 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“We were really happy to build our new portfolio website on ProcessWire! We wanted something that gave us plenty of control on the back-end, without any bloat on the front end - just a nice, easy to access API for all our content that left us free to design and build however we liked.” —Castus, web design agency in Sheffield, UK