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
Laravel Request Analytics

Laravel Request Analytics Laravel Package

me-shaon/laravel-request-analytics

Privacy-first web analytics for Laravel: track real-time page views, visitors, bounce rate, sessions, and performance in a built-in dashboard. Includes bot filtering, geo/device insights, data retention controls, IP anonymization, and a REST API—no third-party sharing.

View on GitHub
Deep Wiki
Context7

Simple request data analytics package for Laravel projects

Frequently asked questions about Laravel Request Analytics
How do I install Laravel Request Analytics in my Laravel 11 project?
Run `composer require me-shaon/laravel-request-analytics` followed by `php artisan request-analytics:install`. The installer handles migrations, configuration, and dashboard setup automatically. Ensure your project uses PHP 8.1+ and Laravel 10/11.
Does this package work with Laravel’s API routes (e.g., for SPAs or mobile apps)?
Yes, the package supports API routes out-of-the-box. Exclude specific paths by adding them to the `ignore-paths` array in the config file. It also integrates with Livewire and Laravel Sanctum for authenticated API tracking.
How does the bot filtering work, and can I customize it?
The package uses a default list of known bots and crawlers (e.g., Googlebot, Slackbot) to filter out fake traffic. You can extend the list by publishing the config (`php artisan vendor:publish --tag=request-analytics-config`) and modifying the `bot-user-agents` array.
What Laravel versions and databases are supported?
The package supports Laravel 10 and 11, PHP 8.1+, and databases like MySQL 5.7+, PostgreSQL 10+, and SQLite 3.8+. No additional database-specific configurations are required beyond Laravel’s default setup.
How do I reduce database overhead for high-traffic sites?
Enable queue processing by setting `queue.enabled = true` in the config to offload analytics collection. Additionally, adjust `pruning.days` (default: 90) to a shorter retention period (e.g., 30 days) and schedule regular pruning via Laravel’s scheduler.
Can I disable geolocation features to save costs or improve performance?
Yes, geolocation is optional. Disable it entirely by setting `geolocation.enabled = false` in the config. If enabled, you can choose between providers like MaxMind (database file) or IPGeolocation (API-based), with fallback options for reliability.
How do I restrict dashboard access to specific users (e.g., admins only)?
Use Laravel’s built-in authorization. Publish the dashboard views (`php artisan vendor:publish --tag=request-analytics-views`) and implement middleware like `auth` or custom gates (e.g., `CanAccessAnalyticsDashboard`) to control access.
Does the package support testing (e.g., unit/feature tests) for analytics data?
Yes, the package includes test helpers. Use `RequestAnalytics::fake()` to mock analytics events in your tests. For database testing, leverage Laravel’s `RefreshDatabase` trait to reset analytics data between tests.
What alternatives exist for Laravel analytics if I need more advanced features?
For simpler setups, consider `spatie/laravel-analytics` (basic tracking). For enterprise needs, integrate third-party tools like Google Analytics via `laravel-google-analytics` or self-hosted solutions like Matomo with `laravel-matomo`. This package stands out for its privacy-first, no-third-party approach.
How do I integrate the REST API with external tools like Grafana or DataDog?
The package includes a REST API endpoint at `/api/analytics`. Use Laravel Passport or Sanctum for authentication. Fetch data via HTTP requests (e.g., `GET /api/analytics/metrics`) and transform it for your external dashboard using tools like Laravel’s `Http` client or Guzzle.
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.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony