Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Read this in German: Lies das auf Deutsch

Counto Banner

Counto Analytics – Modern SQLite Web Analytics

πŸ“Š Single-File SQLite. No Cookies. No Problems.

PHP Version License: GPL v3 Version


πŸ“Š Overview

Counto Analytics is a modern, SQLite-based web analytics system that requires no MySQL. Perfect for shared hosting, runs on any server with PHP 8.1 or higher. Just upload, run the setup, and you're done.

Why Counto Analytics?

Problem Solution
😫 No MySQL available βœ… SQLite single-file database
😫 Cookie banners required βœ… Cookie-free tracking
😫 GDPR issues βœ… Integrated IP anonymization
😫 Complex installation βœ… One-click setup wizard
😫 Slow performance βœ… 10x faster than JSON files
😫 Expensive analytics tools βœ… Free & Open Source

✨ Features

🎯 Core Features

  • βœ… SQLite Database – Single file, no MySQL needed
  • βœ… No installation – Just upload and go
  • βœ… Real-time statistics – Live visitor counting
  • βœ… Responsive design – Mobile & desktop optimized
  • βœ… GDPR compliant – IP anonymization by default
  • βœ… Bot detection – 30+ bot patterns
  • βœ… Modern dashboard – 5 Chart.js charts
  • βœ… Dark/Light mode – Automatic detection

πŸ“ˆ Tracking Features

  • πŸ‘₯ Visitor counting (unique visitors)
  • πŸ‘ Pageviews per page
  • 🌐 Browser, OS, and device detection
  • πŸ”— Referrer tracking
  • ⏰ Hourly and daily distribution
  • 🟒 Live online counter

βš™οΈ Admin Features

  • πŸ“Š 5 interactive Chart.js charts
  • πŸ“ CSV / JSON / Excel export
  • πŸ”’ Password-protected admin area (bcrypt)
  • ⚑ Rate limiting and abuse protection
  • πŸ—‘ Automatic data cleanup
  • πŸ”Œ REST API for developers

πŸ›‘ Security

  • IP anonymization (GDPR)
  • Bcrypt password hashing
  • Recursive directory permissions (755/644)
  • Directory protection via .htaccess
  • Setup self-deactivation after installation
  • No storage of raw IP addresses

πŸš€ Installation in 60 Seconds

1. Upload

Copy the counto/ folder to your web server:

/var/www/html/counto/

2. Open

Navigate to https://yoursite.com/counto/ in your browser.
The system auto-detects that configuration is missing and redirects you to the setup wizard.

3. Setup

  • Step 1: System check (PHP version, SQLite, write permissions)
  • Step 2: Configuration (site name, admin password, timezone, options)
  • Step 3: Completion – copy tracking code

After successful setup, setup.php automatically deactivates itself and all permissions are recursively corrected.

4. Integration

Add the tracking code to your website. The track.php endpoint is served from your Counto installation.

<!-- Simple variant (recommended) -->
<script async src="/counto/track.php?js=1"></script>

<!-- Alternatively, use a full URL if Counto runs on a different (sub)domain: -->
<script async src="https://your-domain.com/counto/track.php?js=1"></script>

<!-- Alternative: Image Pixel -->
<img src="/counto/track.php" width="1" height="1" style="display:none" alt="">

<!-- SPA/React/Vue -->
<script>
fetch('/counto/track.php?page=' + encodeURIComponent(location.pathname));
</script>

5. Done

View statistics at https://yoursite.com/counto/!

πŸ“¦ Production deployment: See DEPLOYMENT.md for a detailed deployment checklist including permissions, security hardening, backups, and migration.


πŸ”§ Technical Details

Component Requirement
PHP 8.1 or higher
Database SQLite 3 (Single-File: statix.db)
Extensions PDO, SQLite, JSON (optional: gd for charts)
Storage ~50 MB per 100,000 visitors
Performance Tracking < 10ms, Dashboard < 500ms
Scalability Up to 100,000 visitors/day
Security Bcrypt hashing, rate limiting, .htaccess protection

File Structure

counto/
β”œβ”€β”€ index.php          # Auto-setup + Public Dashboard
β”œβ”€β”€ admin.php          # Password-protected Admin Panel (7 tabs)
β”œβ”€β”€ api.php            # REST API
β”œβ”€β”€ config.php         # Configuration Manager
β”œβ”€β”€ track.php          # Tracking Endpoint
β”œβ”€β”€ setup.php          # Setup Wizard (auto-deactivates)
β”œβ”€β”€ upgrade.php        # Upgrade from older versions
β”œβ”€β”€ statix.db          # SQLite Database
β”œβ”€β”€ .htaccess          # Apache Configuration
β”œβ”€β”€ inc/               # Modular Backend
β”‚   β”œβ”€β”€ autoload.php   # Autoloader
β”‚   β”œβ”€β”€ Core/          # Core Classes (Auth, Config, Database, Cache)
β”‚   β”œβ”€β”€ Tracking/      # Tracking Logic (Visitor, Session, Bot-Detection)
β”‚   β”œβ”€β”€ Analytics/     # Statistics & Reports
β”‚   β”œβ”€β”€ Interfaces/    # Interface Definitions
β”‚   └── Utils/         # Utilities (Logger, Security, Validator, Http)
β”œβ”€β”€ assets/            # Frontend Resources
β”‚   β”œβ”€β”€ css/           # Stylesheets (Dashboard, Admin, Main)
β”‚   └── js/            # JavaScript (Charts, Dashboard, Admin)
β”œβ”€β”€ data/              # Auto-created by Setup
β”‚   β”œβ”€β”€ visitors/      # Daily Visitor Data
β”‚   β”œβ”€β”€ sessions/      # Session Management
β”‚   β”œβ”€β”€ logs/          # Error and Access Logs
β”‚   β”œβ”€β”€ backups/       # Automatic Backups
β”‚   └── exports/       # CSV/JSON/Excel Exports
β”œβ”€β”€ cache/             # Performance Cache
└── tests/             # Test Suite

πŸ“Š Dashboard

The public dashboard shows at a glance:

  • Live Online Counter – updates every 10 seconds
  • Daily Statistics – Visitors, Pageviews, Total
  • Last 7 Days – Bar chart
  • Last 30 Days – Line chart with trend
  • Today's Distribution – Area chart by hour
  • Browser Distribution – Doughnut chart
  • Top Pages – Ranking of most visited URLs

The admin dashboard additionally offers:

  • 7 Tabs (Overview, Visitors, Pages, Statistics, Export, Settings, Logs)
  • Detailed view of all visitors with filter & search
  • Export functions (CSV, JSON, Excel)
  • Settings for tracking, security, and privacy

πŸ”’ Security & Privacy

GDPR Compliance

  • IP addresses are anonymized (last octet removed)
  • Cookie-free tracking – no consent required
  • No personal data stored
  • Data retention configurable (default: 90 days)

Technical Security

  • Admin area password-protected with bcrypt
  • Rate limiting prevents abuse
  • .htaccess protects all data directories
  • Recursive permissions (directories 755, files 644)
  • setup.php self-deactivates after installation
  • No sensitive data in public dashboard

πŸ”Œ API

If an API key was generated during installation, external systems can access statistics:

GET <YOUR-DOMAIN>/counto/api.php?api_key=wc_XXXX&format=json

Response (JSON):

{
  "today": { "visitors": 145, "pageviews": 312 },
  "online": 12,
  "overall": { "visitors": 12345, "pageviews": 45678 },
  "hourly": { "0": 3, "1": 1, ... "23": 8 },
  "browsers": { "Chrome": 45, "Firefox": 23, ... },
  "last_7_days": { "2026-01-09": 120, ... }
}

❓ FAQ

Does it work on shared hosting? Yes, Counto Analytics only needs PHP 8.1+ with SQLite3. No MySQL database required.
How many visitors can it handle? Up to 100,000 visitors per day. Dashboard load time under 500ms.
Are cookies used? No. Session detection uses IP+UserAgent hash, without cookies or Local Storage.
Is it GDPR compliant? Yes. By default, IP addresses are anonymized, no cookies are set, and no personal data is stored.
Is Counto Analytics ad-free? Yes. 100% ad-free and Open Source. No external calls, no tracking backdoors.

🀝 Support

For questions, issues, or feature requests:


πŸ“„ License

Counto Analytics is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

See LICENSE for the full license text.

Modifications

If you modify and redistribute Counto Analytics, you must:

  • Keep the GPLv3 license
  • State changes made
  • Include original copyright notice

Developed with ❀️ for the Open Source Community

⬆ Back to top


Support the Project

If you find Counto useful and would like to support its development, you can buy me a coffee via Ko-fi. Every contribution helps keep this project free and ad-free.

About

Self-hosted, privacy-focused, and simple web analytics tool. Track your visitors without compromising data privacy. Support the project: https://ko-fi.com/countr

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages