a controller or event listener · open source (MIT) · ask in plain English

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.

a controller or event listener
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.

questions

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.
Do I need a cookie banner?
Not in cookieless mode. smolanalytics can run without storing anything on the device, so there is no consent banner to add. You still get visitors, referrers, funnels, retention, and paths, and AI-assistant referrals (chatgpt.com, claude.ai, perplexity.ai) show up as their own channel.
Is it enough for a real product, or just page counts?
It does funnels, retention, paths, cohorts, and a daily verdict on what to fix, from the same events, and you ask it in plain English. It deliberately skips session replay, feature flags, and experiments. If you want a straight answer on what to fix, that you own and can self-host free, it fits.

keep reading