2017 © Pedro Peláez
 

library footprints

A simple registration attribution tracking solution for Laravel 5.2+ (UTM Parameters and Referrers)

image

sibapp/footprints

A simple registration attribution tracking solution for Laravel 5.2+ (UTM Parameters and Referrers)

  • Wednesday, January 3, 2018
  • by roboticsexpert
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 18 Forks
  • 0 Open issues
  • 24 Versions
  • 0 % Grown

The README.md

:feet: Footprints for Laravel 5.2+ (UTM and Referrer Tracking)

Footprints for Laravel 5.2+ (UTM and Referrer Tracking), (*1)

Latest Version on Packagist ![Software License][ico-license] Build Status ![Total Downloads][ico-downloads], (*2)

Footprints is a simple registration attribution tracking solution for Laravel 5.2+, (*3)

“I know I waste half of my advertising dollars...I just wish I knew which half.” ~ Henry Procter., (*4)

By tracking where user signups (or any other kind of registrations) originate from you can ensure that your marketing efforts are more focused., (*5)

Footprints makes it easy to look back and see what lead to a user signing up., (*6)

Install

Via Composer, (*7)

``` bash $ composer require kyranb/footprints, (*8)


Add the service provider and (optionally) alias to their relative arrays in config/app.php: ``` php 'providers' => [ ... Kyranb\Footprints\FootprintsServiceProvider::class, ], ... 'aliases' => [ ... 'Footprints' => Kyranb\Footprints\FootprintsFacade::class, ],

Publish the config and migration files:, (*9)

``` php php artisan vendor:publish --provider="Kyranb\Footprints\FootprintsServiceProvider", (*10)


Add the ```TrackRegistrationAttribution``` trait to the model you wish to track attributions for. For example: ```php namespace App; use Illuminate\Auth\Authenticatable; use Illuminate\Database\Eloquent\Model; use Kyranb\Footprints\TrackRegistrationAttribution; class User extends Model { use Authenticatable, TrackRegistrationAttribution; /** * The database table used by the model. * * @var string */ protected $table = 'users'; }

Go over the configuration file, most notably the model you wish to track:, (*11)

connection name (optional - if you need a separated tracking database):, (*12)

'connection_name' => 'mytrackingdbconnection', (*13)

model name:, (*14)

'model' => 'App\User', (*15)

authentication guard:, (*16)

'guard' => 'web', (*17)

the column name:, (*18)

'model_column_name' => 'user_id', (*19)

and attribution duration (in seconds), (*20)

'attribution_duration' => 2628000, (*21)

also you can define some route what you don't want to track:, (*22)

'landing_page_blacklist' => ['genealabs/laravel-caffeine/drip', 'admin'], (*23)

if you want to use on multiple subdomain with a wildcard cookie, you can set your custom domain name:, (*24)

'cookie_domain' => .yourdomain.com, (*25)

this boolean will allow you to write the tracking data to the db in your queue (optional):, (*26)

'async' => true, (*27)

Add the \Kyranb\Footprints\Middleware\CaptureAttributionDataMiddleware::class middleware to App\Http\Kernel.php after the EncryptCookie middleware like so:, (*28)

    /**
     * The application's global HTTP middleware stack.
     *
     * These middleware are run during every request to your application.
     *
     * @var array
     */
    protected $middleware = [
        \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
        \App\Http\Middleware\EncryptCookies::class,
        \Kyranb\Footprints\Middleware\CaptureAttributionDataMiddleware::class,
    ];

Usage

How does Footprints work?

Footprints tracks the UTM parameters and HTTP refererers from all requests to your application that are sent by un-authenticated uers. Not sure what UTM parameters are? Wikipedia has you covered:, (*29)

UTM parameters (UTM) is a shortcut for Urchin Traffic Monitor. This text tags allow users to track and analyze traffic sources in analytical tools (f.e. Google Analytics). By adding UTM parameters to URLs, you can identify the source and campaigns that send traffic to your website. When a user clicks a referral link / ad or banner, these parameters are sent to Google Analytics (or other analytical tool), so you can see the effectiveness of each campaign in your reports, (*30)

Here is example of UTM parameters in a URL: www.wikipedia.org/?utm_source=domain.com&utm_medium=banner&utm_campaign=winter15&utm_content=blue_ad&utm_term=headline_v1
# There are 5 dimensions of UTM parameters:
  • utm_source = name of the source (usually the domain of source website), (*31)

  • utm_medium = name of the medium; type of traffic (f.e. cpc = paid search, organic = organic search; referral = link from another website etc.), (*32)

  • utm_campaign = name of the campaign, f.e. name of the campaign in Google AdWords, date of your e-mail campaign, etc., (*33)

  • utm_content = to distinguish different parts of one campaign; f.e. name of AdGroup in Google AdWords (with auto-tagging you will see the headline of - your ads in this dimension), (*34)

  • utm_term = to distinguish different parts of one content; f.e.keyword in Google AdWords, (*35)

What data is tracked for each visit?

  • landing_page
  • referrer_url
  • referrer_domain
  • utm_source
  • utm_campaign
  • utm_medium
  • utm_term
  • utm_content
  • created_at (date of visit)
Get all of a user's visits before registering.

``` php $user = User::find(1); $user->visits;, (*36)


##### Get the attribution data of a user's initial visit before registering. ``` php $user = User::find(1); $user->initialAttributionData();
Get the attribution data of a user's final visit before registering.

``` php $user = User::find(1); $user->finalAttributionData();, (*37)


## Change log Please see the commit history for more information what has changed recently. ## Testing Haven't got round to this yet - PR's welcome ;) ``` bash $ composer test

Contributing

If you run into any issues, have suggestions or would like to expand this packages functionality, please open an issue or a pull request :), (*38)

License

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

The Versions

03/01 2018

dev-master

9999999-dev https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.2+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

03/01 2018

0.2.9-alpha

0.2.9.0-alpha https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.2+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

19/05 2017

0.2.9

0.2.9.0 https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.2+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

19/05 2017

0.2.9-beta

0.2.9.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.2+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

19/05 2017

0.2.8-beta

0.2.8.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

01/03 2017

0.2.7-beta

0.2.7.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

22/11 2016

0.2.6-beta

0.2.6.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

21/11 2016

0.2.5-beta

0.2.5.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

11/11 2016

0.2.4-beta

0.2.4.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

01/11 2016

dev-update_to_5.3

dev-update_to_5.3 https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

06/06 2016

0.2.3-beta

0.2.3.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

18/05 2016

0.2.2-beta

0.2.2.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

28/04 2016

0.2.1-beta

0.2.1.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

04/04 2016

0.2.0-beta

0.2.0.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

24/03 2016

0.1.9-beta

0.1.9.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

20/03 2016

0.1.8-beta

0.1.8.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

20/03 2016

0.1.7-beta

0.1.7.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

12/03 2016

0.1.6-beta

0.1.6.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

29/02 2016

0.1.4-beta

0.1.4.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

29/02 2016

0.1.5-beta

0.1.5.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

29/02 2016

0.1.3-beta

0.1.3.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

19/02 2016

0.1.2-beta

0.1.2.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

18/02 2016

0.1-alpha

0.1.0.0-alpha https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking

18/02 2016

0.1-beta

0.1.0.0-beta https://github.com/kyranb/footprints

A simple registration attribution tracking solution for Laravel 5.1+ (UTM Parameters and Referrers)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyran Beasley

tracking utm footprints utm parameters user tracking attribution tracking