LaravelPackages.net
Acme Inc.
Toggle sidebar
orlserg/utm-recorder

Package to track utm attributes from visitors

23
1
v1.0.29
About orlserg/utm-recorder

orlserg/utm-recorder is a Laravel package for package to track utm attributes from visitors. It currently has 1 GitHub stars and 23 downloads on Packagist (latest version v1.0.29). Install it with composer require orlserg/utm-recorder. Discover more Laravel packages by orlserg or browse all Laravel packages to compare alternatives.

Last updated

UtmRecorder

UtmRecorder help you record utm parameters from visitors and visited urls.

Documentation

Installation

$ composer require orlserg/utm-recorder

Add the service provider and (optionally) alias to their relative arrays in config/app.php:


    'providers' => [
        ...
        \Orlserg\UtmRecorder\UtmRecorderServiceProvider::class,
    ],

...

    'aliases' => [
        ...
        'UtmRecorder' => \Orlserg\UtmRecorder\UtmRecorderFacade::class,
    ],

Publish the config and migration files:

php artisan vendor:publish --provider="Orlserg\UtmRecorder\UtmRecorderServiceProvider"

Add the \Orlserg\UtmRecorder\Middleware\UtmRecorder::class middleware to App\Http\Kernel.php after the EncryptCookie middleware:

    protected $middleware = [
        \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
        \App\Http\Middleware\EncryptCookies::class,
        \Kyranb\Footprints\Middleware\CaptureAttributionDataMiddleware::class,
    ];

Go over the configuration file, and set up settings:

    // your own visitor table
    'link_visits_with' => 'visitors',

    // your own visitor model
    'link_visits_with_model' => \App\Visitor::class,

Run:

$ php artisan migrate

Link your own visitor model with visits table like so:

    public function visits()
    {
        return $this->HasMany(Visit::class, 'owner_id', 'id');
    }

Star History Chart