PHPackages                             pascalkleindienst/laravel-glimpse - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. pascalkleindienst/laravel-glimpse

ActiveLibrary

pascalkleindienst/laravel-glimpse
=================================

00PHPCI passing

Since Mar 21Pushed 1mo agoCompare

[ Source](https://github.com/PascalKleindienst/laravel-glimpse)[ Packagist](https://packagist.org/packages/pascalkleindienst/laravel-glimpse)[ RSS](/packages/pascalkleindienst-laravel-glimpse/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (2)Used By (0)

⚡ Glimpse Analytics
===================

[](#-glimpse-analytics)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0d9c9fa05f34b86992ac107c60ea3416bcbc4a10f675aac954a77da5ab60cd62/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70617363616c6b6c65696e6469656e73742f6c61726176656c2d676c696d7073652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pascalkleindienst/laravel-glimpse)[![GitHub Tests Action Status](https://camo.githubusercontent.com/fb399ee7e2726f549817e9a0ac7bf316948d5b339381faa819da24d3e53e4814/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70617363616c6b6c65696e6469656e73742f6c61726176656c2d676c696d7073652f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/PascalKleindienst/laravel-glimpse/actions/workflows/tests.yml?query=branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/69ca57720d8bc5731bdb9fba843826b5028385661e0175f300684431188585d2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70617363616c6b6c65696e6469656e73742f6c61726176656c2d676c696d7073652f6c696e742e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/PascalKleindienst/laravel-glimpse/actions/workflows/lint.yml?query=branch%3Amain)[![codecov](https://camo.githubusercontent.com/1d83e7551ddbc5b861a535792b86ee1f1517d443ef3b7e1502bbbd8dd550ca17/68747470733a2f2f636f6465636f762e696f2f67682f50617363616c4b6c65696e6469656e73742f6c61726176656c2d676c696d7073652f67726170682f62616467652e7376673f746f6b656e3d4d656c48433461747a76)](https://codecov.io/gh/PascalKleindienst/laravel-glimpse)[![Total Downloads](https://camo.githubusercontent.com/e7295f697ff85f69907fe875c544abe0c7c334c7a27b186cbfa0d3fe0c035088/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70617363616c6b6c65696e6469656e73742f6c61726176656c2d676c696d7073652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pascalkleindienst/laravel-glimpse)

**Privacy-first, server-side analytics for Laravel 12+.**
No cookies. No JavaScript tracking pixel. No GDPR consent banners.
Just clean, fast, anonymous analytics built entirely on the server.

---

Features
--------

[](#features)

- **Zero client-side footprint** — tracking is 100% server-side via a Laravel middleware
- **Session-based unique visitors** — derived from Laravel's existing session ID (SHA-256 hashed, never stored raw)
- **No PII stored** — IPs are one-way hashed with your app key; no names, emails, or identifiers
- **Cookie-free** — no new cookies introduced; uses the session cookie your app already sets
- **Livewire dashboard** — a Pulse-style real-time dashboard at `/glimpse`
- **Custom events** — `Glimpse::event('checkout', ['plan' => 'pro'])`
- **GeoIP** — country, region, city, language (MaxMind or SxGeo, optional)
- **Device detection** — browser, OS, platform (desktop/mobile/tablet)
- **Referrer classification** — organic, social, paid, email, referral, direct
- **Pre-aggregated** — dashboard queries never touch raw tables; fast at any scale
- **Queue-driven** — zero latency added to your requests

---

Requirements
------------

[](#requirements)

DependencyVersionPHP^8.4|^8.5Laravel^12.0|^13.0Livewire^3.6.4|^4.0---

Installation
------------

[](#installation)

```
composer require pascalkleindienst/laravel-glimpse
php artisan glimpse:install
```

`glimpse:install` will:

1. Publish `config/glimpse.php`
2. Publish and run the database migrations
3. Inject `TrackVisitor` middleware into `bootstrap/app.php`
4. Run a health check and print next steps

---

Quick Start
-----------

[](#quick-start)

### 1. Register the middleware

[](#1-register-the-middleware)

The install command does this automatically. If you need to do it manually, add to `bootstrap/app.php`:

```
->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
        \LaravelGlimpse\Http\Middleware\TrackVisitor::class,
    ]);
})
```

### 2. Start the queue worker

[](#2-start-the-queue-worker)

Glimpse dispatches a queued job per request so tracking adds zero latency:

```
php artisan queue:work
```

### 3. Enable the scheduler

[](#3-enable-the-scheduler)

Add to your crontab (or use Laravel's built-in scheduler):

```
* * * * * php /path/to/your/app/artisan schedule:run >> /dev/null 2>&1

```

Glimpse auto-registers two scheduled commands:

- `glimpse:aggregate` — every 5 minutes (aggregates raw data)
- `glimpse:prune` — daily at 03:00 (deletes data beyond the retention window)

### 4. Open the dashboard

[](#4-open-the-dashboard)

```
https://your-app.com/glimpse

```

---

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=glimpse-config
```

---

GeoIP Setup
-----------

[](#geoip-setup)

Geo resolution is **disabled** by default (driver = `null`). To enable:

### MaxMind GeoLite2 (recommended)

[](#maxmind-geolite2-recommended)

1. Sign up for a free MaxMind account and download `GeoLite2-City.mmdb`
2. Place the file at `storage/app/glimpse/GeoLite2-City.mmdb`
3. Set in `.env`:

```
GLIMPSE_GEO_DRIVER=maxmind
GLIMPSE_MAXMIND_DB=/absolute/path/to/GeoLite2-City.mmdb
```

### SypexGeo (no sign-up required)

[](#sypexgeo-no-sign-up-required)

1. Download `SxGeoCity.dat` and `SxGeo.php` from [sypexgeo.net](https://sypexgeo.net)
2. Place both files at `storage/app/glimpse/`
3. Set in `.env`:

```
GLIMPSE_GEO_DRIVER=sxgeo
```

---

Artisan Commands
----------------

[](#artisan-commands)

CommandDescription`glimpse:install`Install Glimpse (publish, migrate, wire middleware)`glimpse:aggregate`Roll raw data into aggregate buckets (auto-scheduled)`glimpse:prune`Delete data beyond retention window (auto-scheduled)`glimpse:backfill`Re-aggregate a historical date range### Backfill historical data

[](#backfill-historical-data)

```
# Backfill the last 90 days
php artisan glimpse:backfill --days=90

# Backfill a specific range
php artisan glimpse:backfill --from=2024-01-01 --to=2024-03-31

# Process in smaller chunks to limit memory usage
php artisan glimpse:backfill --days=365 --chunk=7
```

---

How It Works
------------

[](#how-it-works)

### Session identity

[](#session-identity)

On every request the `TrackVisitor` middleware computes:

```
session_hash = SHA-256(laravel_session_id)

```

This is stored as the visitor identity. The raw session ID is never persisted. When the session expires (default 2 hours in Laravel), so does the identity — genuinely ephemeral.

### Request lifecycle

[](#request-lifecycle)

```
HTTP Request
    │
    ├─ TrackVisitor middleware (sync — reads cache only)
    │      └─ Dispatch ProcessVisitJob to queue
    │
    └─ Response returned immediately ← zero DB writes in the request

Queue worker (async)
    └─ ProcessVisitJob
           ├─ GeoResolver    (IP → country/city)
           ├─ DeviceResolver (UA → browser/OS/platform)
           |- LanguageResolver (Accept-Language Header → language)
           ├─ ReferrerResolver (referer → channel)
           └─ Write to glimpse_sessions + glimpse_page_views

```

### Aggregation

[](#aggregation)

Every 5 minutes, `glimpse:aggregate` reads raw rows and upserts pre-computed buckets into `glimpse_aggregates`. The dashboard **only reads from `glimpse_aggregates`** — it never queries raw tables, so it's fast at any volume.

---

Privacy
-------

[](#privacy)

Glimpse is designed to be GDPR/ePrivacy compliant by default:

- **No cookies introduced** — uses the session cookie already set by Laravel
- **No PII stored** — IPs are one-way hashed (SHA-256 + app key) before storage
- **No third-party requests** — all data stays on your server
- **No cross-site tracking** — identifiers are session-scoped
- **No fingerprinting** — User-Agent is parsed but never stored

> **Legal note**: Glimpse minimizes data collection but you are responsible for your own compliance. Consult a legal professional for advice specific to your jurisdiction.

---

Testing
-------

[](#testing)

```
composer test
```

---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE.md).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance59

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 97.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/367c097ec42aec6ed007853fbec64d138734606e71574341f970e273b3efe7fd?d=identicon)[PascalKleindienst](/maintainers/PascalKleindienst)

---

Top Contributors

[![PascalKleindienst](https://avatars.githubusercontent.com/u/3470866?v=4)](https://github.com/PascalKleindienst "PascalKleindienst (47 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

analyticscookieless-trackinglaravellivewiretracking

### Embed Badge

![Health badge](/badges/pascalkleindienst-laravel-glimpse/health.svg)

```
[![Health](https://phpackages.com/badges/pascalkleindienst-laravel-glimpse/health.svg)](https://phpackages.com/packages/pascalkleindienst-laravel-glimpse)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
