PHPackages                             tavp/analytics - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tavp/analytics

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tavp/analytics
==============

Advanced analytics, fraud detection, and user behavior tracking for TAVP

v0.0.1(1mo ago)03proprietaryPHPPHP &gt;=8.2

Since Jul 9Pushed 3w agoCompare

[ Source](https://github.com/tavp-stack/tavp-analytics)[ Packagist](https://packagist.org/packages/tavp/analytics)[ RSS](/packages/tavp-analytics/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

TAVP Analytics
==============

[](#tavp-analytics)

Advanced analytics, fraud detection, and user behavior tracking for the TAVP stack.

**Version: 0.0.1**

Requirements
------------

[](#requirements)

- PHP 8.3+
- Phalcon 5.16+
- tavp-core

Features
--------

[](#features)

### Core Analytics

[](#core-analytics)

- **Page View Tracking** — every page view across web, mobile, and desktop
- **Session Tracking** — full session lifecycle with duration, bounce detection
- **Custom Events** — track any user action with metadata
- **Real-time Dashboard** — live stats with auto-refresh
- **Geographic Analytics** — country, city, region, ISP
- **Device Analytics** — device type, browser, OS, screen resolution
- **Platform Analytics** — web, iOS, Android, desktop app, mobile app

### Fraud Detection

[](#fraud-detection)

- **Bot Detection** — known bots, crawlers, headless browsers
- **Velocity Checks** — too many requests in short time windows
- **Anomaly Detection** — statistical outlier detection
- **Pattern Detection** — SQL injection, path traversal, known attack patterns
- **Click Fraud** — rapid inhuman click detection
- **Device Fingerprint** — suspicious device characteristics
- **Geographic Rules** — VPN, datacenter IPs, impossible travel

### Fraudless Verification

[](#fraudless-verification)

- **Data Authenticity Scoring** — confirm data represents real human behavior
- **Behavioral Signals** — mouse movement, scroll, focus events, timing patterns
- **Batch Verification** — verify multiple events at once
- **Confidence Scoring** — high/medium/low confidence ratings

### Advanced Features

[](#advanced-features)

- **A/B Testing** — experiment tracking with variant assignment and conversion
- **Funnel Analysis** — multi-step conversion funnels
- **Session Recording** — click and scroll event replay
- **SPA Support** — automatic tracking for single-page applications

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

[](#installation)

```
# Add to your TAVP project
composer require tavp/analytics
```

Quick Start
-----------

[](#quick-start)

### 1. Run Migrations

[](#1-run-migrations)

```
tavp migrate
```

### 2. Add Tracker to Your Layout

[](#2-add-tracker-to-your-layout)

```

```

### 3. Track Custom Events

[](#3-track-custom-events)

```
// From JavaScript
window.tavpAnalytics.event('button_click', 'engagement', 'signup_button');

// From PHP
tavp_analytics_event('button_click', 'engagement', 'signup_button');
```

Configuration
-------------

[](#configuration)

Edit `config/analytics.php`:

```
return [
    'enabled' => true,
    'track_page_views' => true,
    'fraud_detection_enabled' => true,
    'session_recording_enabled' => false,
    'fraud' => [
        'bot_detection' => true,
        'velocity_limit' => 100,
        'block_suspicious' => false,
    ],
];
```

API Endpoints
-------------

[](#api-endpoints)

MethodEndpointDescriptionPOST`/api/analytics/track`Track a page viewPOST`/api/analytics/event`Track a custom eventPOST`/api/analytics/session`Save session recordingPOST`/api/analytics/verify`Verify data authenticityGET`/api/analytics/stats`Get analytics statisticsGET`/api/analytics/experiment/{slug}/variant`Get A/B test variantPOST`/api/analytics/experiment/{slug}/convert`Record conversionPOST`/api/analytics/funnel/{slug}/step`Record funnel stepDashboard
---------

[](#dashboard)

Access the analytics dashboard at `/analytics`.

Fraud Detection
---------------

[](#fraud-detection-1)

The fraud detector runs 7 rules:

1. **Bot Detection** — flags known bots and headless browsers
2. **Velocity** — blocks rapid-fire requests
3. **Anomaly Detection** — statistical outliers in behavior
4. **Device Fingerprint** — mismatched device characteristics
5. **Geographic** — VPN, datacenter IPs
6. **Pattern Detection** — injection attacks, path traversal
7. **Click Fraud** — inhuman click patterns

Each rule returns a score 0.0-1.0. The composite score determines action:

- &lt; 0.5: Clean
- 0.5-0.8: Flagged for review
- > 0.8: Blocked (if enabled)

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance93

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

45d ago

Major Versions

v0.0.0 → v1.0.02026-07-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/45a246eeec15ab5e78eec925cf3829fd5e69c302c1dee58e4e63a1551612a120?d=identicon)[jtdoank](/maintainers/jtdoank)

---

Top Contributors

[![jtdoank](https://avatars.githubusercontent.com/u/5408136?v=4)](https://github.com/jtdoank "jtdoank (9 commits)")

---

Tags

trackinganalyticsfraud detectiontavp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tavp-analytics/health.svg)

```
[![Health](https://phpackages.com/badges/tavp-analytics/health.svg)](https://phpackages.com/packages/tavp-analytics)
```

###  Alternatives

[zumba/amplitude-php

PHP SDK for Amplitude

4110.5M5](/packages/zumba-amplitude-php)[cornford/googlitics

An easy way to integrate Google Analytics with Laravel.

3310.2k](/packages/cornford-googlitics)[axllent/silverstripe-analytics-js

Google Universal Analytics tracking code for Silverstripe

1621.4k](/packages/axllent-silverstripe-analytics-js)[gosquared/php-sdk

1024.0k](/packages/gosquared-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
