New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

jeffersongoncalves/laravel-umami

This Laravel package seamlessly integrates Umami analytics into your Blade templates. Easily track website visits and user engagement directly within your Laravel application, providing valuable insights into your website's performance. This package simplifies the integration process, saving you time and effort. With minimal configuration, you can leverage Umami's powerful analytics features to gain a clearer understanding of your audience and website usage.
3,528 5
Install
composer require jeffersongoncalves/laravel-umami
Latest Version:v3.1.0
PHP:^8.2|^8.3|^8.4
Laravel:12 · 13
Older releases:11
License:MIT
Last Updated:Oct 20, 2026
Links: GitHub  ·  Packagist
Maintainer: jeffersongoncalves

Laravel Umami

Laravel Umami

Buy Me A Coffee

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

This Laravel package seamlessly integrates Umami analytics into your Blade templates. Easily track website visits and user engagement directly within your Laravel application, providing valuable insights into your website's performance. This package simplifies the integration process, saving you time and effort. With minimal configuration, you can leverage Umami's powerful analytics features to gain a clearer understanding of your audience and website usage.

Requirements

Installation

Install the package via composer:

composer require jeffersongoncalves/laravel-umami

If you haven't already, publish the spatie/laravel-settings migration to create the settings table:

php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="migrations"

Then publish and run the Umami settings migration:

php artisan vendor:publish --tag=umami-settings-migrations
php artisan migrate

Usage

Add the Umami script to your Blade layout (typically in the <head> section):

@include('umami::script')

Configuring Settings

Settings are stored in the database and can be managed via code:

use JeffersonGoncalves\Umami\Settings\UmamiSettings;

$settings = app(UmamiSettings::class);
$settings->website_id = 'your-website-id';
$settings->host_analytics = 'https://your-umami-instance.com';
$settings->save();

Available Settings

Property Type Default Description
website_id ?string null Your Umami website ID (required for tracking)
host_analytics string https://cloud.umami.is URL of your Umami instance
host_url ?string null Override data destination URL
auto_track bool true Automatically track pageviews and events
domains ?string null Comma-delimited list of allowed domains
tag ?string null Tag to group events in the dashboard
exclude_search bool false Exclude search parameters from URL
exclude_hash bool false Exclude hash value from URL

Content Security Policy

When your app sets a CSP nonce through Laravel's Vite (Vite::useCspNonce(), as laravel-security-headers does), every <script> this package renders carries it, so a script-src 'self' 'nonce-{nonce}' policy works without 'unsafe-inline'. Scripts loaded afterwards from the vendor's own CDN still need that host in script-src (and its API in connect-src).

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

b4mtech/laravel-umami

A package to add umami analytics to your laravel application

5,378 1
jeffersongoncalves/laravel-cookie-consent

This Laravel package provides a simple and elegant way to implement cookie conse...

18,107 5
jeffersongoncalves/laravel-gtm

This plugin seamlessly integrates Google Tag Manager (GTM) into your website, en...

6,920 4
jeffersongoncalves/laravel-cep

A simple and efficient PHP package for querying Brazilian postal codes (CEP). Th...

6,525 3
jeffersongoncalves/laravel-pwa-favicon

This Laravel package serves a spec-shaped PWA `manifest.json` (with Android dens...

5,222 3

Version History

Version Released PHP Laravel License
v3.1.0 ^8.2|^8.3|^8.4 ^12.61.1|^13.12.0 MIT
v3.0.0 ^8.2|^8.3|^8.4 ^12.61.1|^13.12.0 MIT
v2.0.5 ^8.2|^8.3|^8.4 ^11.0|^12.0|^13.0 MIT
v2.0.4 ^8.2|^8.3 ^11.0|^12.0|^13.0 MIT
v2.0.3 ^8.2|^8.3 ^11.0|^12.0|^13.0 MIT