Analytics
FilaForms tracks form engagement through analytics events. Requires the ANALYTICS feature flag (enabled by default). Events are deduplicated per session to ensure accurate counts.
Tracked Metrics
| Metric | Description |
|---|---|
| Views | Unique sessions that loaded the form |
| Starts | Unique sessions that began filling the form (first field interaction) |
| Submissions | Unique sessions that completed and submitted the form |
| Completion Rate | (submissions / starts) x 100% |
| Avg Time to Complete | Average duration from first interaction to submission (seconds) |
Session Fingerprinting
Each visitor gets a session fingerprint generated using an xxh64 hash. For authenticated users, the session ID is hashed. For anonymous visitors, the IP address and User Agent string are combined and hashed.
Only one event per session per event type is recorded. This prevents duplicate counting from page refreshes or repeated interactions.
Events Table
Events are stored in the form_events table:
| Column | Type | Description |
|---|---|---|
id | ULID | Primary key |
form_id | Foreign key | The form this event belongs to |
event | String | Event type: view, start, or submit |
session_fingerprint | String | Hashed visitor identifier |
created_at | Timestamp | When the event occurred |
Accessing Analytics
Form Summary
$analytics = $form->getAnalytics();
// Returns:
// [
// 'views' => 1250,
// 'starts' => 840,
// 'submissions' => 620,
// 'completion_rate' => 73.8,
// 'avg_time_to_complete' => 45,
// ]
Daily Trends
use FilaForms\Core\Models\FormEvent;
$trends = FormEvent::getDailyAnalytics($formId, days: 30);
Returns a 30-day rolling window of daily event counts grouped by date and event type. Useful for rendering charts showing form performance over time.
Submission Statistics
use FilaForms\Core\Actions\GetFormSubmissionStatsAction;
$stats = app(GetFormSubmissionStatsAction::class)->execute($form);
// Returns:
// [
// 'total' => 620,
// 'today' => 12,
// 'this_week' => 84,
// 'this_month' => 310,
// 'average_per_day' => 20.7,
// 'latest' => '2026-03-06T14:22:00+00:00',
// ]
Dashboard
Analytics are displayed on the form's view page in the admin panel. The dashboard shows a funnel visualization (views to starts to submissions) and submission statistics including totals, averages, and recent activity.