Lean Analytics
On this page
- Use Cases
- Where to Find It
- How It Works
- What Gets Tracked
- Privacy by Design
- Settings
- Enabling Country Detection
- Dashboard Overview
- Content Analytics
- Traffic Sources
- Geographic Data
- Device Breakdown
- Hourly Traffic
- Bot Filtering
- Do Not Track (DNT)
- Data Retention
- Export Data
- Performance
- Comparison with Google Analytics
- FAQ
Track your website’s pageviews and visitor statistics without cookies, personal data collection, or GDPR consent requirements. Get the insights you need while respecting visitor privacy and avoiding the complexity of traditional analytics.
Use Cases
- Track pageviews and visitor trends without cookie consent banners
- Comply with GDPR/CCPA without sacrificing analytics
- Get simple, actionable metrics without data overload
- Reduce dependence on external analytics services
- Keep visitor data on your own server
- Analyze content performance across posts, pages, and custom post types
Where to Find It
Navigate to Switchboard → Analytics to view your analytics dashboard with pageviews, visitors, popular pages, traffic sources, and more.
How It Works
- A lightweight JavaScript beacon tracks pageviews
- Data is stored in your WordPress database (one table)
- No cookies are set on visitor browsers
- No personal data is collected or stored
- View reports in the dedicated analytics dashboard
What Gets Tracked
| Metric | Description |
|---|---|
| Pageviews | Total page loads |
| Unique Visitors | Estimated unique visitors per day |
| Top Posts | Most visited blog posts |
| Top Pages | Most visited pages |
| Other Content | Custom post type analytics (products, portfolios, etc.) |
| Referrers | Where traffic comes from |
| Countries | Visitor geographic distribution (requires CDN) |
| Devices | Mobile, tablet, desktop breakdown |
| UTM Parameters | Campaign tracking (source, medium, campaign) |
| Entry Pages | First pages visitors land on |
| Exit Pages | Last pages before visitors leave |
Privacy by Design
Lean Analytics is built with privacy as the foundation:
No Cookies
Unlike Google Analytics or similar tools, no cookies are set. This means:
- No cookie consent banners required
- No tracking across sessions
- No personal data collection
No Personal Data
The module does NOT collect:
- IP addresses (not stored, only used temporarily for country detection)
- Names, emails, or identifiers
- Browsing history across sites
- Device fingerprints
Visitor Counting
Unique visitors are estimated using a daily rotating hash that combines:
- Date
- User agent
- A random site-specific salt
This creates anonymous daily visitor counts without tracking individuals across sessions.
Settings
| Setting | Type | Default | Description |
|---|---|---|---|
| Respect DNT | Toggle | On | Honor Do Not Track browser setting |
| Filter Bots & Crawlers | Toggle | On | Exclude known bots from analytics |
| Country Detection | Toggle | On | Detect visitor country (requires CloudFlare or CDN) |
| Track Logged-in Users | Toggle | Off | Include logged-in users in stats |
| Exclude Roles | Checkboxes | Admin, Editor | Roles to exclude from tracking |
| Data Retention | Number | 180 | Days to keep analytics data |
Enabling Country Detection
Country statistics require your site to be behind a CDN that provides geographic headers. The module reads the CF-IPCountry header automatically.
Setting Up with CloudFlare
- Add your site to CloudFlare (free plan works)
- Enable the CloudFlare proxy (orange cloud icon)
- CloudFlare automatically adds the
CF-IPCountryheader to requests - Enable “Country Detection” in module settings
- Country data will appear in the Countries tab
Other CDN Providers
Other CDNs that provide geo headers will also work. The module looks for the HTTP_CF_IPCOUNTRY server variable. If your CDN uses a different header, contact support for assistance.
Without a CDN providing geo headers, country detection will not work. The Countries tab will show no data. This is by design to avoid storing IP addresses.
Dashboard Overview
The analytics dashboard shows:
Quick Stats
- Total Pageviews: All-time or selected period
- Unique Visitors: Estimated visitor count
- Pages per Visit: Average pages viewed per session
- Bounce Rate: Percentage of single-page visits
Date Range Selection
Choose from preset ranges:
- Today / Yesterday
- This Week / Last Week
- This Month / Last Month
- Last 30 / 90 / 365 Days
- This Year / Last Year
- All Time
Content Analytics
The dashboard includes dedicated tabs for analyzing different content types:
Posts Tab
View analytics for your blog posts:
- Post title with link to view
- Total pageviews
- Unique visits
- Sorted by most viewed
Pages Tab
View analytics for your static pages:
- Page title with link to view
- Total pageviews
- Unique visits
- Sorted by most viewed
Other Content Tab
View analytics for custom post types (WooCommerce products, portfolio items, etc.):
- Content title with link
- Post type label (Product, Portfolio, etc.)
- Total pageviews
- Unique visits
This is especially useful for:
- E-commerce sites: See which products get the most views
- Portfolio sites: Track which projects attract attention
- Membership sites: Monitor course or lesson popularity
- Directory sites: Identify popular listings
Traffic Sources
Referrers Tab
See where your traffic comes from:
- Domain names of referring sites
- Pageviews from each source
- Visits from each source
Campaigns Tab
Track UTM-tagged marketing campaigns:
| Parameter | Purpose | Example |
|---|---|---|
| utm_source | Traffic source | twitter, newsletter, google |
| utm_medium | Marketing medium | social, email, cpc |
| utm_campaign | Campaign name | spring-sale, product-launch |
Example URL:
https://yoursite.com/page?utm_source=twitter&utm_medium=social&utm_campaign=launchEntry Pages
See which pages visitors land on first. Useful for:
- Identifying effective landing pages
- Understanding how visitors find your site
- Optimizing high-traffic entry points
Exit Pages
See which pages visitors leave from. Useful for:
- Identifying pages that may need improvement
- Understanding visitor journey endpoints
- Finding opportunities to add calls-to-action
Geographic Data
Countries Tab
When country detection is enabled (requires CloudFlare or similar CDN):
- Two-letter country codes
- Pageviews per country
- Visits per country
- Sorted by traffic volume
Device Breakdown
The overview shows device distribution:
- Desktop: Traditional computers
- Mobile: Smartphones
- Tablet: iPads and similar devices
Use this to prioritize responsive design efforts.
Hourly Traffic
View traffic patterns by hour to understand:
- Peak activity times
- Best times to publish content
- Server load patterns
Bot Filtering
When enabled, the module filters out known bots and crawlers:
- Search engine crawlers (Googlebot, Bingbot, etc.)
- Social media crawlers (Facebook, Twitter, LinkedIn)
- SEO tools (Ahrefs, SEMrush, Moz)
- Monitoring services
- Common scraping libraries
This keeps your analytics focused on real human visitors.
Do Not Track (DNT)
When “Respect DNT” is enabled:
- Visitors with DNT enabled in their browser are not tracked
- This honors user privacy preferences
- Recommended to keep enabled for maximum privacy compliance
Data Retention
Configure how long to keep analytics data:
| Retention | Use Case |
|---|---|
| 30 days | Minimal storage, recent trends only |
| 90 days | Quarter-over-quarter comparison |
| 180 days | Half-year trends (default) |
| 365 days | Year-over-year analysis |
Older data is automatically deleted daily via WordPress cron.
Export Data
Export your analytics data for:
- Backup purposes
- External analysis in spreadsheets
- Reporting to clients or stakeholders
Click “Export” in the dashboard to download CSV files.
Performance
The analytics system is designed to be lightweight:
- Minimal JavaScript: Small beacon script (~2KB)
- Async loading: Doesn’t block page rendering
- Indexed database: Fast queries even with millions of rows
- Batch cleanup: Automatic pruning of old data
Comparison with Google Analytics
| Feature | Lean Analytics | Google Analytics |
|---|---|---|
| Cookies | None | Multiple |
| GDPR Consent | Not required | Required |
| Data Location | Your server | Google’s servers |
| Personal Data | None collected | Extensive |
| Setup Complexity | Enable module | Account + code + consent |
| Cost | Free (included) | Free / Paid tiers |
| Features | Essential metrics | Comprehensive |
Lean Analytics trades advanced features for simplicity and privacy.
FAQ
Is this GDPR compliant?
Yes. Since no personal data is collected and no cookies are used, GDPR consent is not required for this analytics tracking. However, consult a legal professional for your specific situation.Can I use this alongside Google Analytics?
Yes. Many sites use Lean Analytics as a privacy-friendly primary tool while running Google Analytics with consent for deeper insights from users who opt in.How accurate is unique visitor counting?
It’s an estimate based on daily visitor hashing. It may undercount visitors who use multiple browsers/devices and overcount those who clear browser data frequently. For most purposes, it’s accurate enough for trend analysis.Does this track logged-in users?
By default, no. Enable “Track Logged-in Users” in settings if you want to include them. You can also exclude specific roles (like administrators) from tracking.Will this slow down my site?
No noticeable impact. The tracking beacon is tiny and loads asynchronously. Database writes are simple inserts. For very high-traffic sites, consider shorter data retention periods.Why is the Countries tab empty?
Country detection requires CloudFlare or a similar CDN that provides geographic headers. Without this, the module cannot determine visitor countries without storing IP addresses (which would violate privacy principles). See “Enabling Country Detection” above for setup instructions.Does this track WooCommerce products?
Yes! The “Other Content” tab shows analytics for all custom post types, including WooCommerce products. You can see which products get the most pageviews and visits.What’s the difference between pageviews and visits?
A pageview is counted each time a page loads. A visit (or session) groups multiple pageviews from the same visitor on the same day. One visitor viewing 5 pages = 5 pageviews, 1 visit.Get access to all 147 modules with a single license