Heratio Help Center article. Category: Admin & Settings.
Usage Statistics
User Guide
Track page views, downloads, and visitor analytics with geographic data, bot filtering, and comprehensive reporting dashboards.
Overview
Key Features
How to Access
Main Navigation
Dashboard
Main Statistics Dashboard
Views Report
Viewing Page Statistics
Go to Statistics → Views
Downloads Report
Tracking File Downloads
Go to Statistics → Downloads
Top Items Report
Most Viewed Records
Go to Statistics → Top Items
Geographic Report
Visitor Locations
Go to Statistics → Geographic
Note: Geographic data requires MaxMind GeoLite2 database. See Settings for setup.
Repository Statistics
Per-Repository Reports
Click on any repository name to view detailed statistics:
Settings
Go to Statistics → Settings
Bot Filtering
Managing Bot Patterns
Go to Statistics → Settings → Manage Bot List
Exporting Data
CSV Export
All reports support CSV export for external analysis:
CLI Commands
Aggregate Statistics
# Run all aggregations (recommended for daily cron)
php artisan ahg:statistics-aggregate --all
# Daily aggregation only
php artisan ahg:statistics-aggregate --daily
# Monthly aggregation
php artisan ahg:statistics-aggregate --monthly
# Cleanup old raw events (keep 90 days)
php artisan ahg:statistics-aggregate --cleanup --days=90
# Backfill aggregates from a start date (Y-m-d)
php artisan ahg:statistics-aggregate --backfill=2026-01-01
Generate Reports
# Summary report (default)
php artisan ahg:statistics-report
# Detailed report
php artisan ahg:statistics-report --type=detailed
# Trends report
php artisan ahg:statistics-report --type=trends
# Limit the number of rows
php artisan ahg:statistics-report --type=detailed --limit=100
# Custom date range
php artisan ahg:statistics-report --start=2026-01-01 --end=2026-01-31
# Export to CSV
php artisan ahg:statistics-report --type=detailed --format=csv --output=/tmp/stats.csv
# JSON output
php artisan ahg:statistics-report --type=summary --format=json
Cron Setup
Recommended Cron Jobs
# Aggregate daily statistics at 2am
0 2 * * * cd /usr/share/nginx/heratio && php artisan ahg:statistics-aggregate --daily
# Monthly aggregation on 1st of month at 3am
0 3 1 * * cd /usr/share/nginx/heratio && php artisan ahg:statistics-aggregate --monthly
# Weekly cleanup of old raw events (Sunday 4am)
0 4 * * 0 cd /usr/share/nginx/heratio && php artisan ahg:statistics-aggregate --cleanup
GeoIP Setup
Installing MaxMind GeoLite2
-
Register for a free account:
-
Download the database:
- Download: GeoLite2-City.mmdb
-
Install the database:
# Create directory
sudo mkdir -p /usr/share/GeoIP
# Copy database
sudo cp GeoLite2-City.mmdb /usr/share/GeoIP/
# Set permissions
sudo chmod 644 /usr/share/GeoIP/GeoLite2-City.mmdb
-
Verify in Settings:
- Go to Statistics → Settings
- GeoIP status should show "Installed"
Understanding the Data
How Statistics Are Collected
Data Retention
Troubleshooting
| Issue |
Solution |
| No statistics showing |
Check if tracking is enabled in Settings |
| Bot traffic included |
Enable bot filtering, update bot patterns |
| No geographic data |
Install MaxMind GeoLite2 database |
| Dashboard slow |
Run php artisan ahg:statistics-aggregate --all to build aggregates |
| Data not current |
Ensure daily cron job is running |
| Export fails |
Check write permissions on export directory |
Privacy Compliance
GDPR/POPIA Features
- Audit Trail - Track who accessed what
- Privacy Plugin - Data subject requests
- Reports Dashboard - General reporting