Download the PHP package code16/metrics without Composer

On this page you can find all versions of the php package code16/metrics. 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 metrics

Metrics

Latest Stable Version Total Downloads License Build

Metrics is a Laravel 5 package aimed at logging visitor's usage of your web application and provides an ensemble of classes and functionnality to help you generate statistics out of it.

It is compliant with EU regulations regarding privacy, and GDPR-Ready.

Installation

You can install the metrics package by typing the following command :

Configuration

THe package ships with a set of ready-to-user Analyzers that are included in default's config file. If you want to customize it, just publish using the appropriate artisan command :

Tracking

Metricsworks by placing a tracking cookie on the user's device, which will be linked to a specific user_id when a user is logged in, so there will be a unique identifier for a single user, whichever device he's using, and the cookie will stay on after a user has logged out, meaning that you can reconstruct a user's sequence before, or after he was logged into the application.

By default, Metrics will log any route accessed within the application, with the exception of when the user has a Do Not Track header set to true. If you do not wish a specific route or group of route to be logged, you can use the included NoTrackingMiddleware, or add a filter in config.

Actions

Actions are an important concept in Metrics. They give you the opportunity to highlight and gather data for further statistic analyzis on some important part of your application. They are very similar to events in how they work, and they are serialized in the metrics_visitstable.

For example, you can create an action class for everytime a user add a product to his cart :

Then, you can attach the action to the current Visit object, by calling the following method on the manager class :

Alternatively, you can use the helper function :

Analyzers & Consoliders

On top of logging your user's visits into a table, Metrics comes with a little "framework" which aims to help you extract statistics from these raw informations. It come out of the box with some basic statistics functions that will for example count the number of unique visitors or analysis the repartition of your users by browser or user agent.

There are two distinct operations that Metrics handles :

Analyze : This operation will produce a statistic array from raw Visit records. Basically metrics passes all rows from the metrics_visit table and listen and store statistics data that is calculated from these raw visit log.

Consolidate : This operation takes several results from several smaller time periods into a larger one.

Raw data are analyzed and consolidated into four incremental time periods :

For some example on how to write custom analyzers/consoliders for your application, you can look into the classes which are included in the package (Code16\Metrics\Analyzers).

Updating statistics

To calculate and update the statistics, simply run artisan metrics:update at any time. Doing so will calculate statistics for all complete period (last hour, last day, last month..), that haven't been calculated yet. TIP : If you implement new Analyzers during the application lifetime, and you want to calculate statistics on previous period, simply truncate metric_metrics table and run another update.


All versions of metrics with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3
illuminate/support Version ^11.0
jenssegers/agent Version ^2.3
doctrine/dbal Version ^3.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 code16/metrics contains the following files

Loading the files please wait ....