PHPackages                             aldeebhasan/laravel-event-tracker - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. aldeebhasan/laravel-event-tracker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

aldeebhasan/laravel-event-tracker
=================================

A privacy-first Laravel package for tracking conversions, events, and user journeys—100% locally stored. No third-party APIs, no external tracking.

1.0.0(9mo ago)41MITPHPPHP ^8.2CI failing

Since Aug 5Pushed 9mo agoCompare

[ Source](https://github.com/aldeebhasan/laravel-event-tracker)[ Packagist](https://packagist.org/packages/aldeebhasan/laravel-event-tracker)[ Docs](https://github.com/aldeebhasan/laravel-event-tracker)[ GitHub Sponsors](https://github.com/aldeebhasan)[ RSS](/packages/aldeebhasan-laravel-event-tracker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

A privacy-first Laravel package for tracking conversions, events, and user journeys—100% locally stored. No third-party APIs, no external tracking.
===================================================================================================================================================

[](#a-privacy-first-laravel-package-for-tracking-conversions-events-and-user-journeys100-locally-stored-no-third-party-apis-no-external-tracking)

[![Latest Version on Packagist](https://camo.githubusercontent.com/23ad39b8dcebd5848bfbd9581b13472d8849d528ce336381352bfefdde9f3eda/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c64656562686173616e2f6c61726176656c2d6576656e742d747261636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aldeebhasan/laravel-event-tracker)[![GitHub Tests Action Status](https://camo.githubusercontent.com/f00dd1866cbdde97612471e6f24dd869dced008929b26c8852d93b3584e0e91d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c64656562686173616e2f6c61726176656c2d6576656e742d747261636b65722f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/aldeebhasan/laravel-event-tracker/actions?query=workflow%3Arun-tests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/e83a8aaade2b89619bfb57d42c6bbc9163997ee184345563d6f0fc9c43df7ca0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c64656562686173616e2f6c61726176656c2d6576656e742d747261636b65722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d6173746572266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/aldeebhasan/laravel-event-tracker/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amaster)[![Codacy Badge](https://camo.githubusercontent.com/bae9cd06cccfb556c594f37ae853045a8f0018fb3fb953c4d58021ed960f1ebc/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3034616637666432363930343432343762396435333330653062376535366132)](https://app.codacy.com/gh/aldeebhasan/laravel-event-tracker/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Total Downloads](https://camo.githubusercontent.com/f35699be430c7fc64976664c493f93b0722adfce9bcf0b4dcc8ffee62441a367/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c64656562686173616e2f6c61726176656c2d6576656e742d747261636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aldeebhasan/laravel-event-tracker)

A simple and flexible Laravel package for tracking events in your application. The laravel-event-tracker package provides an intuitive helper function to log events with minimal setup, abstracting the complexity of event storage and retrieval. It supports multiple drivers (e.g., database, log) and includes Artisan commands to retrieve insightful statistics about your events.

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

[](#installation)

You can install the package via composer:

```
composer require aldeebhasan/laravel-event-tracker
```

You need first to publish and run the migrations with:

```
php artisan vendor:publish --tag="event-tracker-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="event-tracker-config"
```

Usage
-----

[](#usage)

### Track events

[](#track-events)

After the configuration of the target driver you want to use in the config file (log by default), you can start track your users with the following helpers

```
track_event(event:"event name",context: [],user: auth()->user())
```

if you want to use different driver at run time, you can use the tracker helper to configure it.

```
tracker('database')->track_event(event:"event name",context: [],user: auth()->user())
```

Alternately, you can use the package facade to call all the event tracker manager functions

```
\Aldeebhasan\LaravelEventTracker\Facades\EventTracker::driver()->track_event("event name");
```

### View Statistics &amp; Insights

[](#view-statistics--insights)

We have four available commands that can tell you the whole story about your events:

- **event-tracker:frequency** : Show the event frequency bases on specific/all users.
- **event-tracker:event-insights** : Show the event insights for specific/all events within a specific period of time.
- **event-tracker:statistics** : Show general statistics about the events and users.
- **event-tracker:user-insights** : Show the user insights within a specific period of time.

all these commands has 4 input options

```
php artisan event-tracker:command --from=   //  Start date (YYYY-MM-DD) and by default is yesterday
                                  --to=     //  End date (YYYY-MM-DD) and by default is today
                                  --event=  //  Specific event name to filter on
                                  --user_id=// Specific user id to filter on
```

Advanced Setup
--------------

[](#advanced-setup)

### Custom Tracker

[](#custom-tracker)

After publishing of the config, you have the ability to change the default trackers implementation, or add your custom tracker. to configure your custom tracker you can define it in the config file as follow:

```
    'drivers' => [
        /*'database' => [
            'table' => 'events',
            'connection' => 'mysql',
        ],*/
         'custom' => [
            'implementation' => YourProject\Trackers\CustomTracker::class,
            'api-key' => '***********',
            'project' => '***********',
        ],
    ],
```

Then you can use the tracker as follow

```
  tracker('custom')->track_event('action.created');
```

Important

The `CustomTracker` should implement the `TrackerUI` interface

### Additional Resolvers

[](#additional-resolvers)

In the config file you have a resolver array that contain all the resolver applied on the incoming request to extract data from it. If you want to extract extra info from the current request you can create a new resolver class and add it to the resolver list.

As example: let create a new resolver to extract the host from the request:

```
class HostResolver implements ResolveUI
{
    public static function resolve(EventTracker $tracker): string
    {
        return $tracker->preloadedResolverData['host'] ?? (request()->getHost() ?? '');
    }
}
```

Important

The new resolver should implement the `ResolveUI` interface

The new resolver data will be passed within the $meta param within the `track` function in all of the tracker implementation.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Hasan Deeb](https://github.com/aldeebhasan)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance58

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

280d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/74e7b9d93b0f666f462ad0be43dde05991e9d141f9fe840009775808107d440e?d=identicon)[aldeebhasan](/maintainers/aldeebhasan)

---

Top Contributors

[![aldeebhasan](https://avatars.githubusercontent.com/u/62222392?v=4)](https://github.com/aldeebhasan "aldeebhasan (1 commits)")

---

Tags

eventslaraveltrackinglaravelHasan Deeblaravel-event-tracker

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/aldeebhasan-laravel-event-tracker/health.svg)

```
[![Health](https://phpackages.com/badges/aldeebhasan-laravel-event-tracker/health.svg)](https://phpackages.com/packages/aldeebhasan-laravel-event-tracker)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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