fhusquinet/laravel-campaign-activity-tracker

Track the activity of your campaigns on your Laravel application
5,684 3
Install
composer require fhusquinet/laravel-campaign-activity-tracker
Latest Version:v2.2.0
PHP:^7.4|^8.0
License:MIT
Last Updated:Apr 17, 2024
Links: GitHub  ·  Packagist
Maintainer: fhusquinet

Track the activity of your campaigns on your Laravel application

Latest Version on Packagist Total Downloads

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

You can install the package via composer:

composer require fhusquinet/laravel-campaign-activity-tracker

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

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email florian.husquinet@deegital.be instead of using the issue tracker.

Thanks

Special thanks to Spatie for their awesome laravel-activitylog package as well as their skeleton-php package for getting me the inspiration and help required for this package!

Credits

License

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

Related Packages

fhusquinet/laravel-model-json-options

Store options as JSON values easily on your models.

4,553 0
fhusquinet/laravel-google-geocoding

Easy to use API to retrieve geocoding results from Google in your Laravel applic...

3,495 2
gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

628,058,007 9,707