PHPackages                             xcorch/tracker - 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. xcorch/tracker

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

xcorch/tracker
==============

A PHP Composer package for tracking website views to your XCorch dashboard

v1.0.4(4mo ago)119MITPHPPHP &gt;=8.0

Since Jan 9Pushed 4mo agoCompare

[ Source](https://github.com/denismnjima/xcorch-tracker-composer)[ Packagist](https://packagist.org/packages/xcorch/tracker)[ RSS](/packages/xcorch-tracker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (12)Used By (0)

XCorch Tracker
==============

[](#xcorch-tracker)

A PHP Composer package for tracking website views to your XCorch dashboard.

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

[](#installation)

```
composer require xcorch/tracker
```

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

[](#configuration)

Create a `.env` file in your project root with the following variables:

```
XCORCH_API=xcorch_your_api_key_here
XCORCH_WEBSITE_CODE=ABC12345
```

Your API key and website code can be found in your XCorch app or website dashboard.

Usage
-----

[](#usage)

### Basic Tracking

[](#basic-tracking)

Simply call the `track()` method on each page to automatically track page views. The method returns JavaScript code that tracks scroll depth and end time:

```

```

The `track()` method will:

- Check for an existing session in cookies
- Create a new session if one doesn't exist
- Record the page view with entry time and source URL (domain only, e.g., `google.com`)
- Automatically detect device type (mobile/desktop)
- Return JavaScript that tracks scroll depth and sends end time when the user leaves the page

### Excluding Pages from Tracking

[](#excluding-pages-from-tracking)

You can exclude dynamic pages (like products, blogs, etc.) from being tracked:

```
$tracker = new Tracker();

// Exclude specific URL patterns
$tracker->setExcludedPatterns([
    '/products/',
    '/blogs/',
    '/admin/',
    '/\/api\/.*/'  // Regex pattern to exclude all API routes
]);

echo $tracker->track();
```

**Pattern Types:**

- **String patterns**: Simple string matching (e.g., `/products/` will exclude any URL containing `/products/`)
- **Regex patterns**: Must start and end with `/` (e.g., `/\/blogs\/.*/` will exclude all blog URLs)

**Note:** Excluded pages will not create sessions or record views, but will still return empty JavaScript (no tracking code).

### Validate Credentials

[](#validate-credentials)

You can validate your API key and website code:

```
$tracker = new Tracker();
$result = $tracker->validateCredentials();

if ($result['valid']) {
    echo "Credentials are valid!";
    // Access site and business data from $result['data']
} else {
    echo "Validation failed: " . $result['error'];
}
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance77

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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 ~0 days

Total

11

Last Release

124d ago

Major Versions

v0.1.5 → v1.0.02026-01-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3b73a5489fb3cd79a92c24afea2131686e107096bf50f6db96632eecbec193a?d=identicon)[zekenya](/maintainers/zekenya)

---

Top Contributors

[![denismnjima](https://avatars.githubusercontent.com/u/171325234?v=4)](https://github.com/denismnjima "denismnjima (18 commits)")

### Embed Badge

![Health badge](/badges/xcorch-tracker/health.svg)

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

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k441.8k2](/packages/roots-bedrock)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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