5.9 KiB
Analytics Setup Guide
This guide helps you add website analytics to track visitor statistics and behavior.
- Analytics Setup Guide
Overview
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.
Supported Analytics Services
Currently 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
- Cronitor – Uptime monitoring with Real User Monitoring (RUM) analytics
Google Analytics
Google Analytics is free and widely used. It provides detailed insights into visitor behavior.
Setup Steps
-
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
enable_google_analytics: true - Add your Measurement ID:
google_analytics: 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.
Privacy-Friendly Alternatives
If you're concerned about user privacy or GDPR compliance, consider these alternatives:
Pirsch Analytics
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, setenable_pirsch_analytics: true - Add your Site ID:
pirsch_analytics: YOUR_SITE_ID(format: 32 characters) - Commit and push
(The site ID appears in your Pirsch dashboard.)
Openpanel Analytics
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, setenable_openpanel_analytics: true - Add your Client ID:
openpanel_analytics: YOUR_CLIENT_ID(format: UUID) - Commit and push
Monitoring & Performance
Cronitor
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, setenable_cronitor_analytics: true - Add your Site ID:
cronitor_analytics: YOUR_SITE_ID - Commit and push
GDPR and Privacy Considerations
If you're in the European Union or serve EU visitors, consider GDPR requirements:
GDPR Checklist
- 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
Privacy-first services (No GDPR cookie banner needed)
- ✅ Pirsch Analytics
- ✅ Openpanel Analytics
Services requiring cookie consent
- ❌ Google Analytics (EU users must consent first)
- ❌ Cronitor (collects user data via RUM)
Comparing Analytics Services
| Service | Free | GDPR | Setup | Features | Best for |
|---|---|---|---|---|---|
| Google Analytics | ✅ | ⚠️ Requires consent | Easy | Detailed reports | Detailed tracking |
| Pirsch | ✅ Free tier | ✅ | Easy | Balanced | GDPR compliance |
| Openpanel | ✅ | ✅ | Medium | Modern dashboard | Privacy-focused developers |
| Cronitor | Paid | ⚠️ Requires consent | Easy | Uptime + RUM | Uptime monitoring |
Next Steps
- 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.