Download the PHP package kyranb/footprints without Composer

On this page you can find all versions of the php package kyranb/footprints. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package footprints

:feet: Footprints for (UTM and Referrer Tracking)

Latest Version on Packagist Build Status Total Downloads

Footprints is a simple registration attribution tracking solution for Laravel 7+

“I know I waste half of my advertising dollars...I just wish I knew which half.” ~ Henry Procter.

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

Footprints makes it easy to look back and see what lead to a user signing up.

Install

Via Composer

Publish the config and migration files:

Add the \Kyranb\Footprints\Middleware\CaptureAttributionDataMiddleware::class either to a group of routes that should be tracked or as a global middleware in App\Http\Kernel.php (after the EncryptCookie middleware!) like so:

Add tracking to the model where registration should be tracked (usually the Eloquent model \App\Models\User) by implementing the TrackableInterface and using the TrackRegistrationAttribution trait like so:

Configuring

Go over the configuration file, most notably the model you wish to track:

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

model name:

authentication guard:

the column name:

and attribution duration (in seconds)

also you can define some route what you don't want to track:

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

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

tracking in cases where cookies are disabled can be achieved by disabling the setting:

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 users. Not sure what UTM parameters are? Wikipedia has you covered:

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

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:
And how is it logged?

For a more technical explanation of the flow, please consult the section [Tracking process in details](#Tracking process in details) below.

What data is tracked for each visit?

The default configuration tracks the most relevant information

But the package also makes it easy to the users ip address or basically any information available from the request object.

Get all of a user's visits before registering.
Get the attribution data of a user's initial visit before registering.
Get the attribution data of a user's final visit before registering.
Events

The TrackingLogger emits an event RegistrationTracked once a registration has been processed while it is possible to listen for any visits tracked by simply listening for the Eloquent Events on the Visit model.

Tracking process in details

First off the CaptureAttributionDataMiddleware can be registered globally or on a selected list of routes.

Whenever an incoming request passes through the CaptureAttributionDataMiddleware middleware then it checks whether or not the request should be tracked using the class TrackingFilter (can be changed to any class implementing the TrackingFilterInterface) and if the request should be logged TrackingLogger will do so (can be changed to any class implementing TrackingLoggerInterface).

The TrackingLogger is responsible for logging relevant information about the request as a Vist record. The most important parameter is the request's "footprint" which is the entity that should be the same for multiple requests performed by the same user and hence this is what is used to link different requests.

Calculating the footprint is done with a request macro which in turn uses a Footprinter singleton (can be changed to any class implementing FootprinterInterface). It will look for the presence of a footprints cookie (configurable) and use that if it exists. If the cookie does not exist then it will create it so that it can be tracked on subsequent requests. It might be desireable for some to implement a custom logic for this but note that it is important that the calculation is a pure function meaning that calling this method multiple times with the same request as input should always yield the same result.

At some point the user signs up (or any trackable model is created) which fires the job AssignPreviousVisits. This job calculates the footprint of the request and looks for any existing logged Visit records and link those to the new user.

Keeping the footprints table light

Prune the table

Without pruning, the visits table can accumulate records very quickly. To mitigate this, you should schedule the footprints:prune Artisan command to run daily:

By default, all entries unassigned to a user older than the duration you set on the config file with attribution_duration . You may use the days option when calling the command to determine how long to retain Footprint data. For example, the following command will delete all records created over 10 days ago:

=======

Disable robots tracking

Before disabling robots tracking, you will need to install jaybizzle/crawler-detect. To do so : composer require jaybizzle/crawler-detect

Your table can get pretty big fast, mostly because of robots (Google, Bing, etc.). To disable robots tracking, change your footprints.php file on config folder accordingly :

Upgrading

2.x => 3.x

Version 3.x of this package contains a few breaking changes that must be addressed if upgrading from earlier versions.

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 ;)

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 :)

Thanks

Thanks to ZenCast, some of the best Podcast Hosting around.

License

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


All versions of footprints with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
illuminate/support Version ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kyranb/footprints contains the following files

Loading the files please wait ....