Lean Analytics

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

  1. A lightweight JavaScript beacon tracks pageviews
  2. Data is stored in your WordPress database (one table)
  3. No cookies are set on visitor browsers
  4. No personal data is collected or stored
  5. View reports in the dedicated analytics dashboard

What Gets Tracked

MetricDescription
PageviewsTotal page loads
Unique VisitorsEstimated unique visitors per day
Top PostsMost visited blog posts
Top PagesMost visited pages
Other ContentCustom post type analytics (products, portfolios, etc.)
ReferrersWhere traffic comes from
CountriesVisitor geographic distribution (requires CDN)
DevicesMobile, tablet, desktop breakdown
UTM ParametersCampaign tracking (source, medium, campaign)
Entry PagesFirst pages visitors land on
Exit PagesLast 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

SettingTypeDefaultDescription
Respect DNTToggleOnHonor Do Not Track browser setting
Filter Bots & CrawlersToggleOnExclude known bots from analytics
Country DetectionToggleOnDetect visitor country (requires CloudFlare or CDN)
Track Logged-in UsersToggleOffInclude logged-in users in stats
Exclude RolesCheckboxesAdmin, EditorRoles to exclude from tracking
Data RetentionNumber180Days 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

  1. Add your site to CloudFlare (free plan works)
  2. Enable the CloudFlare proxy (orange cloud icon)
  3. CloudFlare automatically adds the CF-IPCountry header to requests
  4. Enable “Country Detection” in module settings
  5. 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:

ParameterPurposeExample
utm_sourceTraffic sourcetwitter, newsletter, google
utm_mediumMarketing mediumsocial, email, cpc
utm_campaignCampaign namespring-sale, product-launch

Example URL:

https://yoursite.com/page?utm_source=twitter&utm_medium=social&utm_campaign=launch

Entry 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:

RetentionUse Case
30 daysMinimal storage, recent trends only
90 daysQuarter-over-quarter comparison
180 daysHalf-year trends (default)
365 daysYear-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

FeatureLean AnalyticsGoogle Analytics
CookiesNoneMultiple
GDPR ConsentNot requiredRequired
Data LocationYour serverGoogle’s servers
Personal DataNone collectedExtensive
Setup ComplexityEnable moduleAccount + code + consent
CostFree (included)Free / Paid tiers
FeaturesEssential metricsComprehensive

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

Get access to all 147 modules with a single license

Upgrade to Pro