This guide helps you add website analytics to track visitor statistics and behavior.
- Analytics Setup Guide
Analytics help you understand your website visitors: where they come from, which pages they visit, and how they interact with your content. al-folio supports several analytics providers that you can enable in _config.yml.
Analytics rendering is owned by the al_analytics plugin. All providers are configured from one block, and a provider turns on as soon as you give it a non-empty ID — there is no separate "enable" step:
analytics:
google: # Google Analytics measurement ID (format: G-XXXXXXXXXX)
cronitor: # Cronitor RUM analytics site ID
pirsch: # Pirsch analytics site ID (32 characters)
openpanel: # Openpanel analytics client ID (UUID)
cloudflare: # Cloudflare Web Analytics beacon token (32 hex characters)The plugin also accepts flat aliases (google_analytics, cronitor_analytics, pirsch_analytics, openpanel_analytics, cloudflare_analytics) which take precedence over the block above. The enable_*_analytics flags are optional off-switches: leave them unset and the provider follows its ID; set one to false to disable that provider without deleting the ID. Setting enable_google_analytics: true on its own does nothing.
Simple Analytics is the one exception. It identifies a site by its domain rather than by an embedded key, so there is no ID to put in the block above and nothing for the plugin to infer intent from. It is therefore controlled by its flag alone and stays off until you turn it on:
enable_simple_analytics: trueCurrently implemented in al-folio:
- Google Analytics – Free, feature-rich, but collects user data
- Pirsch Analytics – GDPR-compliant, free tier available, European servers
- Openpanel Analytics – Open-source option, privacy-focused
- Cloudflare Web Analytics – Free, cookieless, no sampling
- Simple Analytics – Privacy-first, no cookies, paid after trial
- Cronitor – Uptime monitoring with Real User Monitoring (RUM) analytics
Google Analytics is free and widely used. It provides detailed insights into visitor behavior.
-
Create a Google Analytics account:
- Visit Google Analytics
- Sign in with your Google account
- Click Start measuring → Create account
-
Create a property for your website:
- Enter your website name and URL
- Accept terms and continue
- Choose your timezone and currency
-
Get your Measurement ID:
- In the left sidebar, go to Admin → Properties
- Click Data Streams → Web (or your existing stream)
- Copy the Measurement ID (format:
G-XXXXXXXXXX)
-
Enable in your site:
- Open
_config.ymlin your repository - Set your Measurement ID under the
analyticsblock:analytics.google: G-XXXXXXXXXX - Commit and push
- Open
-
Verify it's working:
- Visit your website
- Go back to Google Analytics → Real-time tab
- You should see your visit appear within a few seconds
Note: Google Analytics takes 24-48 hours to start showing data trends.
If you're concerned about user privacy or GDPR compliance, consider these alternatives:
Best for: GDPR-compliant analytics without complex setup
Features:
- ✅ GDPR compliant
- ✅ European servers
- ✅ Free tier available
- ✅ Simple integration
- ✅ No cookie consent needed
Setup:
- Sign up at Pirsch.io
- Add your domain
- Copy the tracking code
- In
_config.yml, set your Site ID under theanalyticsblock:analytics.pirsch: YOUR_SITE_ID(format: 32 characters) - Commit and push
(The site ID appears in your Pirsch dashboard.)
Best for: Open-source and privacy-conscious developers
Features:
- ✅ Open-source
- ✅ Self-hosted option available
- ✅ Privacy-focused
- ✅ Modern dashboard
Setup:
- Sign up at Openpanel.dev
- Create a project for your website
- Get your Client ID
- In
_config.yml, set your Client ID under theanalyticsblock:analytics.openpanel: YOUR_CLIENT_ID(format: UUID) - Commit and push
Best for: Free, privacy-friendly analytics with no cookies and no sampling
Features:
- ✅ Free, with no traffic cap
- ✅ Cookieless — no consent banner required
- ✅ No sampling: every page view is counted
- ✅ Works without putting your site behind Cloudflare's proxy
⚠️ Deliberately minimal — no funnels, segments or custom events
Setup:
- Open the Cloudflare dashboard and go to Analytics & Logs → Web Analytics
- Add your site's hostname
- Cloudflare shows a beacon snippet — copy the token value out of
data-cf-beacon='{"token": "..."}', not the whole snippet - In
_config.yml, set it under theanalyticsblock:analytics.cloudflare: YOUR_TOKEN(32 hex characters) - Commit and push
You do not need to proxy your DNS through Cloudflare for this to work; the beacon is a plain script tag.
Best for: Privacy-first analytics where you want nothing stored on the visitor's device
Features:
- ✅ No cookies, no fingerprinting, no persistent identifiers
- ✅ GDPR/CCPA compliant, EU-hosted
- ✅ No consent banner required
⚠️ Paid after the trial period
Setup:
Simple Analytics identifies your site by its domain, so unlike every other provider here there is no ID to configure — which also means the plugin cannot tell you want it on. Turn it on explicitly:
- Sign up at SimpleAnalytics.com and add your domain
- In
_config.yml, setenable_simple_analytics: true(top level, not inside theanalyticsblock) - Commit and push
Cronitor is an uptime monitoring service with RUM (Real User Monitoring) analytics.
Best for: Tracking if your site is online + basic performance metrics
Setup:
- Create account at Cronitor.io
- Get your Site ID
- In
_config.yml, set your Site ID under theanalyticsblock:analytics.cronitor: YOUR_SITE_ID - Commit and push
If you're in the European Union or serve EU visitors, consider GDPR requirements:
- If using Google Analytics: Add cookie consent banner
- Display a privacy policy explaining what analytics you use
- Allow users to opt-out if using tracking cookies
- Use privacy-first alternatives when possible
- ✅ Pirsch Analytics
- ✅ Openpanel Analytics
- ✅ Cloudflare Web Analytics
- ✅ Simple Analytics
- ❌ Google Analytics (EU users must consent first)
- ❌ Cronitor (collects user data via RUM)
| Service | Free | GDPR | Setup | Features | Best for |
|---|---|---|---|---|---|
| Google Analytics | ✅ | Easy | Detailed reports | Detailed tracking | |
| Pirsch | ✅ Free tier | ✅ | Easy | Balanced | GDPR compliance |
| Openpanel | ✅ | ✅ | Medium | Modern dashboard | Privacy-focused developers |
| Cloudflare | ✅ | ✅ | Easy | Minimal | Free cookieless basics |
| Simple Analytics | Paid | ✅ | Easy | Minimal | Strict privacy |
| Cronitor | Paid | Easy | Uptime + RUM | Uptime monitoring |
- Choose a service based on your needs (privacy, features, budget)
- Follow the setup guide for your chosen service
- Verify it's working by visiting your site and checking the analytics dashboard
For more customization help, see CUSTOMIZE.md.