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

Analytics Laravel Package

artisanpack-ui/analytics

Laravel package adding an admin UI for analytics: configure tracking, view key metrics and reports, and manage dashboards from your application. Designed to integrate quickly with common Laravel stacks and provide a clean, configurable analytics panel.

View on GitHub
Deep Wiki
Context7

A privacy-first analytics package for Laravel applications, providing local database storage for complete data ownership, GDPR-compliant consent management, real-time dashboards, multi-tenant support, and optional integration with Google Analytics 4 and Plausible.

Frequently asked questions about Analytics
How do I install artisanpack-ui/analytics in a Laravel 11/12 project?
Run `composer require artisanpack-ui/analytics`, then execute `php artisan analytics:install` to publish migrations, config, and assets. For Laravel 13, ensure your stack supports Livewire 3 and the required `orchestra/testbench` dependencies. Always check the [README](https://github.com/ArtisanPack-UI/analytics) for version-specific notes.
Does this package store analytics data locally, or does it rely on external services?
By default, all analytics data is stored locally in your database, giving you full ownership and GDPR compliance. You can optionally integrate with Google Analytics 4 or Plausible for cross-platform tracking, but local storage remains the primary method.
How do I enable the AI-powered insights feature in artisanpack-ui/analytics?
First, install the AI dependency with `composer require artisanpack-ui/ai`. Then, register AI features in your `AnalyticsServiceProvider` using `AnalyticsServiceProvider::aiFeatures()`. Without this step, AI components won’t appear in the admin UI.
What Laravel versions are officially supported, and are there breaking changes?
The package supports Laravel 11, 12, and 13 without breaking changes for existing users. Laravel 13 users must verify compatibility with `orchestra/testbench` and `illuminate/*` dependencies. Always test in a staging environment before upgrading.
How do I handle GDPR compliance with user consent and data deletion?
The package includes built-in consent management via `@analyticsConsentBanner` and GDPR-compliant IP anonymization. To delete user data, implement a `deleteDigestPreferences()` method in your user model and ensure the `analytics_digest_preferences` table is purged. Check the [GDPR section](https://github.com/ArtisanPack-UI/analytics) for full compliance guidelines.
Can I use this package in a multi-tenant Laravel application?
Yes, the package supports multi-tenancy via domain, subdomain, API key, or header-based resolution. For AI features, explicitly scope queries with `tenant_id` to avoid cross-tenant data leaks. Configure tenant resolution in the `analytics.php` config file.
What are the system requirements for the AI features (e.g., queue workers, storage)?
AI features require queue workers to process `SendDigestEmailJob` and a configured mail driver (SMTP, Mailgun, etc.). Store email templates in Blade or Markdown format and ensure Redis is available for caching AI responses to reduce latency. Monitor queue backlogs to avoid email delays.
How do I track custom events or page views programmatically?
Use the helper methods `trackEvent('event_name', ['key' => 'value'])` for custom events and `trackPageView('/path', 'Page Title')` for page views. For real-time updates, ensure your Livewire components are properly wired to the analytics dashboard.
Are there alternatives to artisanpack-ui/analytics for Laravel analytics?
Popular alternatives include Laravel Analytics (by Spatie), Matomo Analytics (self-hosted), and third-party services like Google Analytics 4 or Plausible. However, artisanpack-ui/analytics stands out for its privacy-first approach, AI-driven insights, and seamless Laravel integration without vendor lock-in risks.
How do I configure data retention and cleanup for analytics data?
Data retention is configurable in the `analytics.php` config file. Set `retention_days` to define how long raw data is stored before aggregation. Run `php artisan analytics:cleanup` manually or schedule it via Laravel’s scheduler to automate cleanup and reduce database bloat.
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor