Download the PHP package alifahmmed/metrics-tracker without Composer

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

๐Ÿ“Š MetricsTracker

A Laravel package to track impressions, clicks, and CTR (Click-Through Rate) for any model like pages, posts, banners, or other content. Inspired by platforms like Fiverr and Upwork.


โœจ Features


๐Ÿ“ฆ Installation

Then publish the migration:

๐Ÿ”ง Setup

๐ŸŽฎ 1. How to Use in Controller You can easily integrate metrics tracking (impressions and clicks) directly in your controllers.

๐Ÿ‘๏ธ Store Impressions (e.g., in index() method) To track impressions when showing a list of items:

This will:

Store an impression only once per user/IP per day

Automatically attach a metric_token to each model for tracking clicks

๐Ÿ–ฑ๏ธ Store Clicks (e.g., in show() method) To track clicks when a user views or interacts with a single item:

This will:

Store a click only if an impression exists for today

Attach the metric_token to the model for reference

๐Ÿ” 2. Filter Metrics by Days You can filter impressions and clicks by a specific range of days using this snippet:

Accepted values for days: 1, 7, 14, 30, 60, 90, 180, 365

This will return all metrics grouped by:

trackable_type

type (impression or click)

date

๐Ÿ“ˆ 3. Calculate CTR (Click-Through Rate) To calculate CTR for a specific model, ID, and day range, use:

Replace YourModel::class with your actual model class.

Replace $trackableId with the model ID.

Replace 30 with any day value (1, 7, 14, 30, 60, 90, 180, 365).

If there are no impressions, the CTR will return 0.

๐Ÿ“Š How It Works ๐Ÿ‘๏ธ Impression is tracked when an element becomes visible in the viewport.

๐Ÿ–ฑ๏ธ Click is tracked when an element is clicked.

๐Ÿ“ˆ CTR (Click-Through Rate) is calculated based on total clicks / total impressions * 100.

๐Ÿ›  Artisan Commands Clean up metrics older than 90 days (adjustable):

๐Ÿงช Example Usage (Controller or API) If you're building a SPA or headless app, you can also generate tokens server-side:

๐Ÿง‘โ€๐Ÿ’ป Author S M Alif Ahmmed

โš– License MIT License. Use it freely in personal and commercial projects.

โญ Like it? Give it a โญ on GitHub and share it with your Laravel friends!


All versions of metrics-tracker with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/support Version ^9.0|^10.0|^11.0|^12.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 alifahmmed/metrics-tracker contains the following files

Loading the files please wait ...