Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Visitor Tracker Bundle Laravel Package

beast/visitor-tracker-bundle

View on GitHub
Deep Wiki
Context7

๐Ÿ•ต๏ธ 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

๐Ÿš€ Features ๐Ÿงพ File-Based Logging Tracks each request in structured .log files โ€” no database needed.

  • โœ… Rich Visitor Metadata Captures:
    • IP address (anonymized if enabled)
    • Browser, OS, device type
    • Referrer, UTM parameters
    • Country, city, ISP (via optional geo API)
    • Auth status, route name, HTTP status
    • Request duration, memory usage, response size
    • Bot detection and unique visitor fingerprinting
  • โš™๏ธ CLI-First Analytics Everything runs from the Symfony CLI โ€” no external dashboards, no browser needed.
  • ๐Ÿ“Š Purpose-Driven Tools Tailored commands for:
    • Sysadmin: detect warnings, high memory usage, and timeouts
    • DevOps: status code trends, duration spikes, CDN usage
    • Marketing: campaign UTM performance and visitor source summaries
    • Developers: route usage, controller profiling
  • ๐Ÿ“ˆ Real-Time Monitoring Stream logs live using visitor:tail and analyze hot traffic without delay.
  • ๐Ÿง  Smart Aggregation Group by route, URI, hour, date, browser, country, UTM source, and more.
  • ๐Ÿ”’ Privacy & Compliance Ready
    • No cookies or sessions
    • IP masking and optional geolocation
    • Consent-free operation (GDPR/CCPA friendly by default)
  • ๐Ÿ“‚ Minimal Setup, Zero Overhead Plug-and-play with Symfony. Just install and go โ€” logging starts immediately.

๐Ÿš€ Installation

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'

๐Ÿง  How It Works

Every main request triggers the logger:

Beast\VisitorTrackerBundle\EventSubscriber\VisitorLoggerSubscriber

...and at termination, enriches the last matching log entry with:

  • request duration
  • memory usage
  • HTTP status
  • route name
  • content type
  • authentication status

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
    }
}

๐Ÿงช CLI Commands

visitor:tail

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

visitor:metric

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.

visitor:trend

Track visitor trends over time

Useful for spotting traffic spikes or drop-offs.

bin/console visitor:trend --type=requests|bots|utm --days=30

visitor:sysadmin

Health check for your app/server

Scans for:

  • PHP warnings & errors
  • Memory spikes
  • Long-running requests
  • Unexpected status codes
bin/console visitor:sysadmin

visitor:devops

Operational diagnostics

Breaks down:

  • CDN or URI usage patterns
  • Route-level performance
  • Traffic load by hour
  • Status code trends
bin/console visitor:devops

visitor:snapshot

Point-in-time export

Generate a snapshot JSON of visitor data for sharing, archiving, or analysis.

bin/console visitor:snapshot --output=stats.json

๐Ÿ“ˆ visitor:cleanup

Full dashboard for the last 30 days.

php bin/console visitor:stats

Includes:

  • Total / unique / returning / bot visitors
  • Hourly & daily charts
  • Country, city, browser, device, OS, UTM, referrer stats
  • Top visited pages
  • Weekly aggregates

๐Ÿ’ก Use Cases

  • Lightweight, private web analytics
  • Monitoring APIs/microservices
  • Campaign/UTM effectiveness analysis
  • Debugging slow or memory-hungry routes
  • GDPR-safe internal dashboards

๐Ÿ” Privacy & Compliance

We collect only:

  • IP (anonymized if enabled)
  • User-Agent
  • UTM/referrer
  • Route/URI & status
  • Duration & memory usage (no personal data)

โœ… No cookies, sessions, or user tracking unless you add it manually. โœ… Fully usable without consent banners. โ— Geolocation via ipapi.co can be disabled.


๐Ÿ‘ค Author

Michael Holm Kristensen Part of the Clubmaster GmbH ecosystem ๐Ÿ”— github.com/hollodk


๐Ÿ“„ License

MIT โ€” Use it freely, fork it proudly.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle