Add analytics to Laravel.
smolanalytics fits Laravel two ways: server-side events posted with the Http client from controllers, jobs and listeners, and a browser snippet in your Blade layout that autocaptures pageviews and clicks. One write key for both. You ask your numbers in plain English and get deterministic reports.
use Illuminate\Support\Facades\Http;
Http::withToken('WRITE_KEY')->post('https://YOUR-INSTANCE/v1/events', [
'name' => 'signup',
'distinct_id' => (string) $user->id,
'properties' => ['plan' => 'pro'],
]);
{{-- Web autocapture: put these two tags in resources/views/layouts/app.blade.php <head> --}}
{{-- <script src="https://YOUR-INSTANCE/sdk.js"></script> --}}
{{-- <script>smolanalytics.init("WRITE_KEY", { host: "https://YOUR-INSTANCE" })</script> --}}dispatch the POST from a queued job or an event listener so it runs on your queue worker, not the web request.
how do I add analytics to laravel?
smolanalytics fits Laravel two ways: server-side events posted with the Http client from controllers, jobs and listeners, and a browser snippet in your Blade layout that autocaptures pageviews and clicks. One write key for both. You ask your numbers in plain English and get deterministic reports.
Laravel's event system is a clean home for this. An OrderPaid event, a listener, one Http::withToken call to /v1/events, and the payment is recorded from the server where it actually happened. Push it onto the queue so the user's request stays fast. The Blade layout carries the two script tags for browser autocapture, and identify(user.id) after login ties the web session to the same person.
The backend is a single Go binary: self-host it free (MIT) or run hosted from $29/mo, cookieless with no consent banner. Every answer is a deterministic report with a CI test proving it can't be hallucinated. Ask in plain English from the dashboard bar or from your editor over MCP, no query builder required.
Honest pricing: 14-day full trial, no credit card. Then Solo $29/mo, never metered on seats or sites. Overage is $5/million with an emailed receipt, the dashboard never locks, and self-hosting the single Go binary is free forever (MIT).
Add analytics to Laravel tonight.
One snippet, or one endpoint. Tomorrow morning the verdict tells you which part of the funnel to fix.