PHPackages                             glw/monitoring-metrics - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. glw/monitoring-metrics

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

glw/monitoring-metrics
======================

A PHP library for auto-refreshing the browser using WebSocket.

1152PHP

Since Aug 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Gumillar88/monitoring-metrics)[ Packagist](https://packagist.org/packages/glw/monitoring-metrics)[ RSS](/packages/glw-monitoring-metrics/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

monitoring-metrics
==================

[](#monitoring-metrics)

Monitoring Metrics is a Component library designed to help you monitor and track various user activities on your website or application. This library enables you to easily capture and log metrics such as the number of clicks, reports, page views, and downloads.

Features
--------

[](#features)

- **Click Tracking:** Monitor the number of times elements are clicked.
- **Page View Tracking:** Track the number of views each page receives.
- **Download Tracking:** Log and count file downloads.

Installation
------------

[](#installation)

Install via Composer:

```
composer require glw/monitoring-metrics
```

Usage
-----

[](#usage)

First, ensure that you have included the namespace and imported the necessary classes:

```
use Glw\MonitoringMetrics\MonitoringMetrics;
```

Tracking Clicks
---------------

[](#tracking-clicks)

To track a click event on a specific element, use the trackClick method:

```
$metrics = new MonitoringMetrics();
$metrics->trackClick('button_123');
```

Tracking Page Views
-------------------

[](#tracking-page-views)

To track a page view, use the trackPageView method:

```
$metrics->trackPageView('homepage');
```

Tracking Downloads
------------------

[](#tracking-downloads)

To track a file download, use the trackDownload method:

```
$metrics->trackDownload('/path/to/file.zip');
```

Example
-------

[](#example)

Below is an example of how you can use this library within a Laravel controller:

```
