Download the PHP package artisanpack-ui/analytics without Composer
On this page you can find all versions of the php package artisanpack-ui/analytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package analytics
ArtisanPack UI Analytics
ArtisanPack UI Analytics is a privacy-first analytics package for Laravel applications. Built on Livewire 3, it provides 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.
Quick Start
Installation
Basic Usage
Key Features
- Privacy First: Local database storage for complete data ownership
- GDPR Compliant: Built-in consent management with Do Not Track support
- Real-Time Dashboard: Beautiful Livewire dashboard with live visitor counts
- Session Tracking: Track visitors, sessions, page views, and bounce rates
- Event Tracking: Custom event tracking with categories and values
- Goal Tracking: Set up conversion goals with progress tracking
- Multi-Tenant Support: Domain, subdomain, API key, and header-based resolution
- External Providers: Optional integration with Google Analytics 4 and Plausible
- Queue Processing: High-performance async tracking for busy sites
- Data Retention: Configurable retention with automatic cleanup and aggregation
- IP Anonymization: GDPR-compliant IP address handling
- Bot Filtering: Automatic exclusion of known bots and crawlers
AI features
The Analytics package ships four AI agents that plug into artisanpack-ui/ai. Every feature is toggleable via the artisanpack.ai.features.{key}.enabled config (or the AI package's runtime registry) — Livewire, React, and Vue triggers all render a "disabled" state when a feature is off.
| Feature key | Input | Output | Default model |
|---|---|---|---|
analytics.insight_summary |
{ date_range, metrics, compare_to? } |
{ summary, highlights[], concerns[] } |
claude-sonnet-4-6 (streams) |
analytics.explain_anomaly |
{ anomaly: {metric,direction,magnitude,date}, context: {recent_content_changes, referrer_deltas, campaign_launches} } |
{ hypotheses:[{cause,confidence,evidence[]}], recommended_next_steps[] } |
claude-sonnet-4-6 |
analytics.segment_insight |
{ segment:{type,value}, metrics, baseline } |
{ patterns:[{observation,significance,suggested_action}] } |
claude-sonnet-4-6 |
analytics.digest_email |
{ items[], focus?, length? } (inherits SummarizationAgent) |
{ summary, key_points[], caveats[] } |
claude-sonnet-4-6 |
Livewire triggers
React / Vue triggers
Publish the components alongside the analytics dashboards (analytics-react / analytics-vue publish tags) and mount them anywhere in your Inertia app:
Enabling / disabling features
Every feature is opt-in per-app via config/artisanpack.php (merged from the AI package):
Requests are gated by the analytics.ai.use gate. The ship default allows any authenticated user; override in your AuthServiceProvider for stricter policies.
Digest email opt-in
The analytics.digest_email feature is delivered via a queued job (SendDigestEmailJob) and honors a per-user preference stored in analytics_digest_preferences (off | weekly | monthly). Users pick their cadence via the DigestSubscription component; you schedule SendDigestEmailJob on your cadence of choice (the job is a no-op for users whose preference is off or missing).
Components
Livewire Components
| Component | Description |
|---|---|
AnalyticsDashboard |
Full-featured analytics dashboard with all widgets |
StatsCards |
Summary statistics (page views, visitors, sessions, bounce rate) |
VisitorsChart |
Interactive line chart of visitors over time |
TopPages |
Most visited pages table with view counts |
TrafficSources |
Referrer breakdown with percentage charts |
RealtimeVisitors |
Live count of active visitors |
GoalProgress |
Goal completion tracking with progress bars |
ConsentBanner |
GDPR consent collection banner |
Widget Usage
Documentation
Comprehensive documentation is available at our Documentation Site:
- Getting Started - Quick start guide
- Installation Guide - Detailed setup instructions
- Configuration - All configuration options
- Tracking Page Views - Page view tracking
- Tracking Events - Custom event tracking
- Components - Dashboard and widget components
- Multi-Tenancy - Multi-tenant setup
- Privacy & Consent - GDPR compliance
- API Reference - Models, services, and events
Configuration
Publish the configuration file:
Environment Variables
The package supports the following environment variables:
| Variable | Description | Default |
|---|---|---|
ANALYTICS_ENABLED |
Enable/disable all tracking | true |
ANALYTICS_ACTIVE_PROVIDERS |
Comma-separated list of providers | local |
ANALYTICS_DB_CONNECTION |
Database connection for analytics | null (default) |
ANALYTICS_TABLE_PREFIX |
Prefix for analytics tables | analytics_ |
ANALYTICS_ANONYMIZE_IP |
Anonymize visitor IP addresses | true |
ANALYTICS_QUEUE_PROCESSING |
Process tracking via queues | true |
ANALYTICS_QUEUE_NAME |
Queue name for async processing | analytics |
ANALYTICS_RETENTION_PERIOD |
Days to retain data (null = forever) | 90 |
ANALYTICS_DASHBOARD_PREFIX |
URL prefix for dashboard routes | analytics |
ANALYTICS_CACHE_DURATION |
Dashboard cache duration in seconds | 300 |
ANALYTICS_MULTI_TENANT |
Enable multi-tenant mode | false |
ANALYTICS_CONSENT_REQUIRED |
Require consent before tracking | false |
ANALYTICS_RESPECT_DNT |
Honor Do Not Track headers | true |
ANALYTICS_GOOGLE_ENABLED |
Enable Google Analytics 4 | false |
ANALYTICS_GOOGLE_MEASUREMENT_ID |
GA4 Measurement ID | null |
ANALYTICS_GOOGLE_API_SECRET |
GA4 API Secret | null |
ANALYTICS_PLAUSIBLE_ENABLED |
Enable Plausible Analytics | false |
ANALYTICS_PLAUSIBLE_DOMAIN |
Plausible domain | null |
ANALYTICS_PLAUSIBLE_API_URL |
Plausible API URL | https://plausible.io/api |
Configuration Options
Key configuration options in config/artisanpack/analytics.php:
Artisan Commands
Scheduling Commands
Add to your scheduler for automated maintenance:
Requirements
- Laravel 11 or 12: PHP 8.2+
- Laravel 13: PHP 8.3+
- Livewire 3.6.4+
Dependencies
The package has minimal external dependencies:
- doctrine/dbal - Database abstraction
- nesbot/carbon - Date handling
- livewire/livewire - Reactive components
Optional integrations with the ArtisanPack UI ecosystem:
- artisanpack-ui/livewire-ui-components - UI components for dashboard
- artisanpack-ui/hooks - WordPress-style hooks for extensibility
Events
The package dispatches events for key actions:
Extensibility
Custom Analytics Providers
Create custom providers by implementing AnalyticsProviderInterface:
Custom Site Resolvers (Multi-Tenant)
Which site a request is for is decided once for the whole ArtisanPack UI
ecosystem, by artisanpack-ui/core. Implement its contract, which is keyed on
the site identifier so packages need not share models:
See Multi-Tenancy for migrating a resolver
written against the deprecated SiteResolverInterface.
Filter Hooks
Extend functionality using filter hooks:
Contributing
Contributions are welcome! To contribute:
- Fork the repository
- Create your feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'Add feature') - Push to the branch (
git push origin feature/your-feature) - Open a Merge Request
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting merge requests.
License
ArtisanPack UI Analytics is open-sourced software licensed under the MIT license.
All versions of analytics with dependencies
artisanpack-ui/ai Version ^1.0
artisanpack-ui/core Version ^1.3.1
artisanpack-ui/hooks Version ^1.3
doctrine/dbal Version ^4.0
illuminate/cache Version ^11.0|^12.0|^13.0
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/queue Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
livewire/livewire Version ^3.6.4|^4.0
nesbot/carbon Version ^2.0|^3.0