Jump to content

RockAnalytics - Integrate plausible analytics into your ProcessWire backend


Recommended Posts

 

RockAnalytics.svg

Integrate plausible analytics or umami into your ProcessWire backend

https://github.com/baumrock/RockAnalytics

q7IIR5V.png

Quickstart:

  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

hr.svg

Donations

img

😎🤗👍

hr.svg

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: https://plausible.io/plausible.io

hr.svg

Tracking Snippet

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 = "https://plausible.verdino.com/js/plausible.js";
  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 "example.com", 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 "example.com.ddev.site" so all visits will not show up in the plausible dashboard for example.com; Now we add another website to plausible with the domain "example.com.ddev.site" and voila - we will see our dev-websites' visitors in realtime.

hr.svg

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".

68747470733a2f2f692e696d6775722e636f6d2f576a6b525531512e706e67

 

  • Like 13
Link to comment
Share on other sites

  • 2 weeks later...

Nice to know, thx! Does the iframe height fit as well?

Both tools are very similar. When doing my research I had the feeling that plausible is a little more mature and has some more features (like password protecting the share screen).

Maybe the module will get some updates in the future that use the API (for example showing the page view count in the page tree like PageHitCounter does). That would need different implementations for plausible and umami, so it's good to think about maybe supporting both upfront.

  • Like 2
Link to comment
Share on other sites

The iframe fits very well. As if it was made for umami.

They are indeed very similar.

I prefer umami as I can host it super easy on either Vercel or Netlify, while using my own database.
Another thing I really like is, that I can customize the script name to whatever I want - so blocking extensions won't catch it.

Maybe plausible offers the same but as said before... hosting and setup was super easy.

You can even get a testdrive up and running via railway.app within minutes.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...