Weave 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, self-hosted web analytics for Laravel with a real-time dashboard for page views, visitors, bounce rate, sessions, geo/device breakdowns, bot filtering, and REST API access. No third-party data sharing.

View on GitHub
Deep Wiki
Context7

Laravel Request Analytics is a privacy-first web analytics package for Laravel applications. It tracks traffic, visitors, and performance through a clean, real-time dashboard without sending any data to third parties—no Google Analytics required. With built-in IP anonymization, GDPR-friendly defaults, and retention controls, you stay fully in control of your data.

  • Real-time dashboard with page views, visitors, bounce rate, and session duration
  • Smart bot filtering that automatically excludes crawlers and monitoring tools
  • Geo & device insights covering location, browser, OS, and device, with multiple provider support
  • REST API access for custom reporting and integrations
  • Zero third-party sharing with configurable data retention
Frequently asked questions about Laravel Request Analytics
How do I install laravel-request-analytics in a Laravel app?
Run composer require me-shaon/laravel-request-analytics, then run php artisan request-analytics:install. The interactive installer handles the config file, migrations, views and published assets in one pass. If you prefer manual control, you can publish each piece individually by tag. Requirements are PHP 8.1+ or higher and Laravel 10.0+ or higher.
Does laravel-request-analytics support Laravel 11 and 12?
The package states support for PHP 8.1+ and Laravel 10.0+, and the README includes Laravel 11 scheduling examples, so it is current for modern Laravel versions. There is no published policy for future Laravel majors, so treat upgrade compatibility as something to verify per release. Published views and assets live in your app and become local forks that can drift from upstream. Pin the version and review changes before major framework upgrades.
Will laravel-request-analytics slow down my Laravel application?
Tracking is implemented as middleware on the HTTP kernel, so every tracked request becomes an insert via Eloquent. By default it writes to your application's default database connection and the queue is disabled, meaning synchronous writes on the hot path. For high-traffic apps, enable the queue and point the package at a separate database connection. If geo lookup is enabled with a remote provider, you may also get a synchronous third-party HTTP call per request unless you queue it.
Is laravel-request-analytics GDPR compliant and does it anonymize IP addresses?
The package is privacy-first and self-hosted, so no data leaves your infrastructure, but the compliant defaults are opt-in rather than on by default. IP anonymization is configurable and defaults to false, and visitor uniqueness is cookie-based, which can imply consent obligations in the EU and UK. The documented masking approach covers the last IPv4 octet, while IPv6 handling is not explicitly stated. Review these settings with your legal requirements before going live.
How do I secure the analytics dashboard route?
The package ships a CanAccessAnalyticsDashboard contract that you implement on your User model to control access. The published middleware config has auth and auth:sanctum commented out by default and instead relies on the package's own request-analytics.access middleware, so verify its exact semantics before exposing the route. A traffic dashboard reveals internal paths, referrers and volumes, so treat it as sensitive and lock it down behind your normal authentication.
How do I stop the analytics table from growing forever?
Retention is controlled by a configurable number of days, and pruning uses Laravel's native model:prune command. You must actually schedule that command, otherwise rows accumulate indefinitely. There is no described rollup or aggregation layer, so table growth is linear in traffic and the 5-minute dashboard cache only reduces read cost, not storage. Plan the prune schedule alongside your database capacity.
Does it track single-page apps, Inertia or Livewire navigation?
Capture is server-side and middleware-driven, so it records requests that hit your Laravel backend. Client-side navigation in a SPA that does not trigger a server round-trip will be undercounted. This is request-level web analytics for page views, visitors, referrers, devices and geo, not an event pipeline for funnels or custom event taxonomy. If you need behavioral product analytics, use a dedicated event tracking tool instead.
Which geo provider should I use with laravel-request-analytics?
The package supports multiple geo providers and lets you select one in config. The IP-API free tier is limited to roughly 45 requests per minute, which is a hard ceiling for busy sites. For production traffic, prefer a local MaxMind database or heavily queue and rate-limit lookups. Leaving geo disabled is the cheapest option if location data is not essential.
Can I query the analytics data programmatically with an API?
Yes, the package exposes a REST API that provides programmatic access to all analytics data for custom reporting and integrations. That lets you build your own dashboards or pipe metrics into other tooling without touching the database directly. You should protect the API endpoints with the same access controls you apply to the dashboard. Confirm the route prefixes and authentication middleware in the published config before exposing them.
How do I exclude admin routes, bots or specific IPs from being tracked?
Configuration includes ignore paths, IP and CIDR skip lists, referrer skip lists, and separate capture toggles for web, API and bots. Bot filtering is built in and excludes crawlers and monitoring tools by default. Add your admin panels and health check endpoints to the ignore paths so internal traffic does not pollute reports. If you run behind a proxy or load balancer, make sure trusted proxy headers are configured so the IP skip lists work as intended.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections