PHPackages                             fhusquinet/laravel-campaign-activity-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. fhusquinet/laravel-campaign-activity-tracker

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

fhusquinet/laravel-campaign-activity-tracker
============================================

Track the activity of your campaigns on your Laravel application

v2.2.0(3y ago)35.7k[4 PRs](https://github.com/fhusquinet/laravel-campaign-activity-tracker/pulls)MITPHPPHP ^7.4|^8.0

Since May 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/fhusquinet/laravel-campaign-activity-tracker)[ Packagist](https://packagist.org/packages/fhusquinet/laravel-campaign-activity-tracker)[ Docs](https://github.com/fhusquinet/laravel-campaign-activity-tracker)[ RSS](/packages/fhusquinet-laravel-campaign-activity-tracker/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (5)Versions (15)Used By (0)

Track the activity of your campaigns on your Laravel application
================================================================

[](#track-the-activity-of-your-campaigns-on-your-laravel-application)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1e49cad767f81372dc48c2a3517ab8807bdf44190d226249c4055104846170d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666875737175696e65742f6c61726176656c2d63616d706169676e2d61637469766974792d747261636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fhusquinet/laravel-campaign-activity-tracker)[![Total Downloads](https://camo.githubusercontent.com/92db737b2a3988a8df59a67e40800543e7b96c455817018815ca402e6bec803c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666875737175696e65742f6c61726176656c2d63616d706169676e2d61637469766974792d747261636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fhusquinet/laravel-campaign-activity-tracker)

If you are managing AdWords or Facebook campaigns using UTM parameters in your URLs this package might be for you! Simply add the TracksCampaignActivity trait on your wanted models and the TrackCampaigns Middleware to your wanted routes and see what impact your campaigns have on your data. It will track the created, updated and deleted event on the models using the TracksCampaignActivity and store the UTM parameters, url and time of visit of each different instance in the database.

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

[](#installation)

You can install the package via composer:

```
composer require fhusquinet/laravel-campaign-activity-tracker
```

Usage
-----

[](#usage)

Add the TracksCampaignActivity trait to your wanted models.

```
// App\Models\Article.php

namespace App\Models;

use FHusquinet\CampaignActivityTracker\Traits\TracksCampaignActivity;
use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    use TracksCampaignActivity
```

And add the TrackCampaigns middleware to your wanted routes, you can either set it at the global level or on a route basis.

```
\\ App/Http/Kernel.php

/**
 * The application's route middleware groups.
 *
 * @var array
 */
protected $middlewareGroups = [
    'web' => [
        //
        \FHusquinet\CampaignActivityTracker\Middleware\TrackCampaigns::class
    ],
```

```
\\ App/Http/Kernel.php

protected $routeMiddleware = [
    //
    'campaignTracker' => \FHusquinet\CampaignActivityTracker\Middleware\TrackCampaigns::class
];

// routes/web.php
Route::get('/')->middleware('campaignTracker');
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Thanks
------

[](#thanks)

Special thanks to Spatie for their awesome [laravel-activitylog package](https://github.com/spatie/laravel-activitylog) as well as their [skeleton-php package](https://github.com/spatie/skeleton-php) for getting me the inspiration and help required for this package!

Credits
-------

[](#credits)

- [Florian Husquinet](https://github.com/fhusquinet)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity76

Established project with proven stability

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 ~164 days

Recently: every ~323 days

Total

10

Last Release

1436d ago

Major Versions

1.0.6 → 2.0.02021-01-19

PHP version history (3 changes)1.0.0PHP ^7.0

2.0.0PHP ^7.4

2.1.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b275f513a587efd768abe8becd7269de9b0eb869feb75b631131edc2cd6e3052?d=identicon)[fhusquinet](/maintainers/fhusquinet)

---

Tags

fhusquinetlaravel-campaign-activity-tracker

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fhusquinet-laravel-campaign-activity-tracker/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)

PHPackages © 2026

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