beast/visitor-tracker-bundle
A modern, developer-friendly, privacy-aware Symfony bundle for tracking, analyzing, and auditing traffic to your app or site โ with zero JavaScript, no cookies, and full CLI access.
Built for privacy-first analytics, sysadmin diagnostics, devops monitoring, and marketing insights โ from a single log source.
Note: This tool is not designed to replace Google Analytics or enterprise-grade analytics suites. It shines in the early stages of development, during MVP testing, or in debugging phases where performance insights, traffic logs, and CLI-driven analytics are more valuable than dashboards. It prioritizes simplicity, speed, and visibility for developers and teams.
๐ Features ๐งพ File-Based Logging Tracks each request in structured .log files โ no database needed.
composer require beast/visitor-tracker-bundle
If you're not using Symfony Flex, manually register the bundle:
// config/bundles.php
return [
Beast\VisitorTrackerBundle\BeastVisitorTrackerBundle::class => ['all' => true],
];
// config/packages/beast_visitor_tracker.yaml
beast_visitor_tracker:
geo_enabled: false # Disable geo API calls for privacy
ip_anonymize: true # Mask last part of IP address
log_dir: '%kernel.project_dir%/var/visitor_tracker/logs'
Every main request triggers the logger:
Beast\VisitorTrackerBundle\EventSubscriber\VisitorLoggerSubscriber
...and at termination, enriches the last matching log entry with:
Log entries are stored per day:
var/visitor_tracker/logs/YYYY-MM-DD.log
Example entry:
{
"date": "2025-07-27 11:31:25",
"ip": "127.0.0.1",
"uri": "\/serial-number?utm_source=facebook&utm_campaign=summer",
"method": "GET",
"user_agent": "Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/136.0.0.0 Safari\/537.36",
"visitor_id": "574136fe4bbfcbdf48c98e38e50604cbd448e9d9",
"referrer": null,
"referrer_domain": null,
"referrer_path": null,
"country": "unknown",
"city": null,
"isp": null,
"browser": "Chrome",
"os": "Linux",
"device": "desktop",
"is_bot": false,
"utm": {
"utm_source": "facebook",
"utm_campaign": "summer"
},
"locale": "en-US",
"duration_ms": 21.02,
"status_code": 200,
"route": "app_serialnumber_index",
"memory_usage_bytes": 4194304,
"auth": "anon",
"content_type": "text\/html; charset=UTF-8",
"response_size_bytes": 45423,
"php_warnings": {
"notice": 0,
"warning": 0,
"deprecated": 0,
"error": 0
}
}
Real-time traffic monitor
Stream new visitor logs as they happen.
bin/console visitor:tail --follow
Options:
--filter=bot|utm|referrer|new|return
--date=YYYY-MM-DD
--preview=20
Internal system metrics from logs
Summarizes durations, memory, payload, response size, errors, and performance.
bin/console visitor:metric --from=-7days
Great for: performance profiling and trend detection.
Track visitor trends over time
Useful for spotting traffic spikes or drop-offs.
bin/console visitor:trend --type=requests|bots|utm --days=30
Health check for your app/server
Scans for:
bin/console visitor:sysadmin
Operational diagnostics
Breaks down:
bin/console visitor:devops
Point-in-time export
Generate a snapshot JSON of visitor data for sharing, archiving, or analysis.
bin/console visitor:snapshot --output=stats.json
visitor:cleanupFull dashboard for the last 30 days.
php bin/console visitor:stats
Includes:
We collect only:
โ
No cookies, sessions, or user tracking unless you add it manually.
โ
Fully usable without consent banners.
โ Geolocation via ipapi.co can be disabled.
Michael Holm Kristensen Part of the Clubmaster GmbH ecosystem ๐ github.com/hollodk
MIT โ Use it freely, fork it proudly.
How can I help you explore Laravel packages today?