This plugin adds privacy-friendly, lightweight analytics to your Micro.blog site using GoatCounter. It uses a tracking pixel and optionally includes inline JavaScript to enhance the tracking with HTTP referrer data, without relying on cookies or any third-party scripts. You need to have a free GoatCounter account to use this plugin.
- Static tracking pixel (
<img>
) with page path and title - Optional inline JavaScript to include the HTTP referrer
- Fully GDPR-friendly: No cookies, no third-party tracking, no fingerprinting
- A tracking request is sent to your GoatCounter domain with the current page path and title.
- If JavaScript tracking is enabled and the visitor came from an external site, the referrer is added.
- If JavaScript is disabled or blocked, a
<noscript>
fallback ensures basic page view tracking still works.
- Register and setup your free GoatCounter account.
- Create a free GoatCounter vanity URL.
- Go to the Micro.blog plugin directory and install the plugin from there.
- Include the tracking partial
{{ partial "goatcounter.html" . }}
in the footer.html of your theme, or wherever appropriate. - Go to the plugin settings and enter your tracking domain, e.g.
https://name.goatcounter.com
orhttps://stats.example.com
. Ensure you enter the full URL includinghttps://
and without/count
. - Optional: Enable inline JavaScript for sending the referrer to GoatCounter
This plugin uses a privacy-focused implementation of GoatCounter with no external JavaScript from GoatCounter itself. This design respects user privacy but comes with a few important limitations:
No JavaScript = limited data
Without the official GoatCounter JS, only basic pageview tracking is available via image requests or inline scripts. This means you can only track:
- Page paths
- Page titles
- Optional referrer (when local JS is enabled)
You won’t see data about:
- Operating systems (e.g., macOS, Windows)
- Browsers (e.g., Chrome, Safari)
- Device types or screen sizes
- Used (Browser) languages of your visitors
- Countries of your visitors
Referrer tracking is optional and limited
If you activate the inline JS, the plugin tries to capture document.referrer
using local JavaScript.
- Referrers from the same hostname are ignored
- Only works if the user has JavaScript enabled
You must use your own GoatCounter domain (e.g. https://stats.example.com
). Using the default *.goatcounter.com
URL may not work due to CORS restrictions.
René Fischer – https://fischr.org