ohseesoftware/laravel-server-analytics
Server-side analytics for Laravel that tracks page views, referrers, UTM parameters, and visitor data without client-side JavaScript. Lightweight, privacy-friendly, and easy to integrate with a simple API and dashboard-ready storage.
composer require ohseesoftware/laravel-server-analyticsphp artisan vendor:publish --tag=server-analytics-config.env (tracking/measurement ID, API secret if applicable, and the queue connection to use for analytics jobs)use OhSeeSoftware\ServerAnalytics\Facades\Analytics;
use OhSeeSoftware\ServerAnalytics\Data\PageView;
Analytics::pageView(
PageView::make('/pricing', 'Pricing')
);
Or dispatch the queued variant to avoid blocking the request:
use OhSeeSoftware\ServerAnalytics\Jobs\TrackPageView;
TrackPageView::dispatch('/pricing', 'Pricing');
Where to look first:
config/server-analytics.php — credentials, enabled flag, queue settingsAnalytics facade and its underlying client classsrc/Data — request/event DTOs introduced or changed in v4src/Jobs — queued tracking jobs and their serialization behaviourTrackPageView job for every GET request, passing the path, title, and any server-side context (user ID, IP, user agent).UserCreated, OrderPaid) by dispatching analytics jobs after the database transaction commits.onQueue('analytics')) so slow analytics endpoints do not delay transactional jobs.->afterCommit() (Laravel 8+) on the job dispatch to avoid tracking data that was rolled back.Queue::fake() to assert jobs are dispatched, and the package’s fake (if provided) to assert payloads without hitting the network.Analytics:: call, job class, and DTO constructor after upgrading. Method names, argument order, or return types may have changed.serialize()/unserialize() locally.tries, backoff, and timeout on the job. Monitor the failed_jobs table; a failing analytics job should not mask real application errors.enabled flag: Disable tracking in local and testing environments via SERVER_ANALYTICS_ENABLED=false to avoid polluting production analytics.queue.connections.database.retry_after is lower than the job timeout, jobs can be retried while still running. Set retry_after appropriately or use Redis/SQS with tuned visibility timeouts.Http::fake() to assert the outbound analytics request payload. This catches DTO changes and provider API mismatches without network calls.Queue::fake(), and verify one real event end-to-end in a staging environment before deploying.How can I help you explore Laravel packages today?