PHPackages                             mattitjaab/mattitja-analytics - 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. [API Development](/categories/api)
4. /
5. mattitjaab/mattitja-analytics

ActiveLibrary[API Development](/categories/api)

mattitjaab/mattitja-analytics
=============================

Laravel middleware package for sending analytics data to Mattitja Analytics API

v1.1.0(4mo ago)04MITPHPPHP ^8.3

Since Sep 30Pushed 4mo agoCompare

[ Source](https://github.com/MattitjaAB/mattitja-analytics)[ Packagist](https://packagist.org/packages/mattitjaab/mattitja-analytics)[ RSS](/packages/mattitjaab-mattitja-analytics/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

Mattitja Analytics for Laravel
==============================

[](#mattitja-analytics-for-laravel)

A Laravel middleware package for sending analytics data to the Mattitja Analytics API. The package automatically registers middleware for web routes and sends data synchronously to the analytics service.

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

[](#installation)

```
composer require mattitjaab/mattitja-analytics
```

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

[](#configuration)

Publish the configuration file (optional):

```
php artisan vendor:publish --tag=mattitja-analytics-config
```

Add your site key to your `.env` file:

```
MATTITJA_ANALYTICS_SITE_KEY=your-site-key
MATTITJA_ANALYTICS_ENABLED=true
```

Usage
-----

[](#usage)

The package automatically registers middleware for the `web` group and starts collecting analytics data immediately after installation and configuration.

### Manual middleware registration

[](#manual-middleware-registration)

You can also add the middleware manually for specific routes:

```
// In routes/web.php
Route::middleware(['mattitja-analytics'])->group(function () {
    // Your routes here
});
```

Configuration Options
---------------------

[](#configuration-options)

### Basic Settings

[](#basic-settings)

- `MATTITJA_ANALYTICS_SITE_KEY` - Your site key from Mattitja Analytics (required)
- `MATTITJA_ANALYTICS_ENABLED` - Enable/disable tracking (default: true)
- `MATTITJA_ANALYTICS_BOTS` - Track bots (default: false)

### Privacy Settings

[](#privacy-settings)

- `MATTITJA_ANALYTICS_RESPECT_DNT` - Respect Do Not Track header (default: true)

### Filtering

[](#filtering)

You can configure paths and IP addresses to ignore in the config file.

Data Sent
---------

[](#data-sent)

The package sends the following data to `https://analytics.mattitja.cloud/api/send`:

- `k` - Site key
- `u` - Full URL of the visited page
- `r` - Referrer URL (if available)
- `ip` - Visitor's complete IP address
- `ua` - User agent string

Security
--------

[](#security)

- Data is sent synchronously directly from middleware
- IP addresses are NOT anonymized (needed for geolocation)
- Bot traffic is filtered out by default
- Do Not Track header is respected by default

Development
-----------

[](#development)

Run tests:

```
composer test
```

License
-------

[](#license)

MIT License

###  Health Score

38

—

LowBetter than 84% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~95 days

Total

2

Last Release

126d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f056a6d34a58ca4e884445093eb513ee4ae7977ecdd937c099a3ea8399cac0d?d=identicon)[Mattitja](/maintainers/Mattitja)

---

Top Contributors

[![mathiaspalmqvist](https://avatars.githubusercontent.com/u/51116221?v=4)](https://github.com/mathiaspalmqvist "mathiaspalmqvist (5 commits)")

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mattitjaab-mattitja-analytics/health.svg)

```
[![Health](https://phpackages.com/badges/mattitjaab-mattitja-analytics/health.svg)](https://phpackages.com/packages/mattitjaab-mattitja-analytics)
```

###  Alternatives

[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[surface/laravel-webfinger

A Laravel package to create an ActivityPub webfinger.

113.8k](/packages/surface-laravel-webfinger)

PHPackages © 2026

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