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

ActiveLibrary

tautid/tracker
==============

server side pixel tracker package

00[4 PRs](https://github.com/tautid/tracker/pulls)PHPCI passing

Since Nov 25Pushed 1mo agoCompare

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

READMEChangelogDependenciesVersions (4)Used By (0)

Taut Tracker - Server-Side Pixel Tracking Package
=================================================

[](#taut-tracker---server-side-pixel-tracking-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c84044b26d6f14dd132fb7882fa4fe2152e2143550d8723d40c720aaa0c36367/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7461757469642f747261636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tautid/tracker)[![GitHub Tests Action Status](https://camo.githubusercontent.com/47db27d4c22c10f8aa4e5fd75ce13f7069bca3982fc3a9003649b79ac60f08ab/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7461757469642f747261636b65722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/tautid/tracker/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/85e75aaf65aeccf393333bb5d8697bd59af08a9a43ca498c1cc7ee09e29c259d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7461757469642f747261636b65722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/tautid/tracker/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/e2a09653dcc81472e8cdfb30d817852bbbaf6d4f1ef01f9faf26a228fbfcf02a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7461757469642f747261636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tautid/tracker)

A comprehensive Laravel package for server-side pixel tracking and conversion management. Track user conversions across multiple advertising platforms (Meta, Google Ads, etc.) with support for multiple drivers, event management, and advanced conversion summaries.

Features
--------

[](#features)

- 🎯 **Multi-Driver Support** - Track pixels with Meta (Facebook) and easily extend with additional drivers
- 📊 **Conversion Tracking** - Create, manage, and monitor pixel conversions with status tracking
- 🔄 **Event Management** - Define and manage pixel events with flexible driver integration
- 📈 **Conversion Summaries** - Generate daily conversion summaries for analytics
- 🗄️ **MongoDB Integration** - Built-in MongoDB support for high-volume tracking
- ⚡ **Queue Support** - Efficient job queuing for conversion processing
- 🛡️ **Type-Safe** - Full PHP 8.3+ type support with Spatie Laravel Data

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

[](#installation)

You can install the package via composer:

```
composer require tautid/tracker
```

Publish and run the migrations:

```
php artisan vendor:publish --tag="tracker-migrations"
php artisan migrate
```

Publish the config file:

```
php artisan vendor:publish --tag="tracker-config"
```

Optionally publish the views:

```
php artisan vendor:publish --tag="tracker-views"
```

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

[](#configuration)

After publishing, the config file will be available at `config/taut-tracker.php`:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Drivers
    |--------------------------------------------------------------------------
    |
    | List of all drivers supported by this package.
    | Supported: meta
    |
    */
    'drivers' => [
        'meta',
    ],

    /*
    |--------------------------------------------------------------------------
    | Database Configuration
    |--------------------------------------------------------------------------
    |
    | Database setup for MongoDB tracker connection
    |
    */
    'connections' => [
        'taut-mongotrack' => [
            'driver' => 'mongodb',
            'dsn' => env('DB_MONGOTRACK_URI', 'mongodb://localhost:27017'),
            'database' => 'mongotrack',
        ],
    ],
];
```

Ensure your `.env` file includes the MongoDB connection URI:

```
DB_MONGOTRACK_URI=mongodb://localhost:27017
```

Usage Guide
-----------

[](#usage-guide)

### 1. Creating Pixel Events

[](#1-creating-pixel-events)

Pixel events represent conversion actions you want to track. Create them using the `PixelEventService`:

```
use TautId\Tracker\Services\PixelEventService;
use TautId\Tracker\Data\PixelEvent\CreatePixelEventData;

$service = app(PixelEventService::class);

$pixelEvent = $service->createPixelEvent(
    new CreatePixelEventData(
        name: 'Purchase Conversion',
        driver: 'meta', // or other supported drivers
        event: 'Purchase',
        pixel_id: 'your-meta-pixel-id',
        token: 'your-meta-token',
        reference: null, // Optional model reference
    )
);
```

### 2. Retrieving Pixel Events

[](#2-retrieving-pixel-events)

Get all pixel events or a specific one:

```
// Get all pixel events
$allEvents = $service->getAllPixelEvents();

// Get a specific pixel event by ID
$event = $service->getPixelEventById($eventId);

// Get paginated pixel events with filtering
use TautId\Tracker\Data\Utility\FilterPaginationData;

$paginatedEvents = $service->getPaginatedPixelEvents(
    new FilterPaginationData(
        page: 1,
        per_page: 15,
        // Add additional filter criteria
    )
);
```

### 3. Creating Conversions (Pixel Tracking)

[](#3-creating-conversions-pixel-tracking)

Track user conversions with pixel data:

```
use TautId\Tracker\Services\PixelTrackerService;
use TautId\Tracker\Data\PixelTracker\CreatePixelTrackerData;

$trackerService = app(PixelTrackerService::class);

$conversion = $trackerService->createConversion(
    new CreatePixelTrackerData(
        pixel_id: $pixelEvent->id,
        data: [
            'value' => 99.99,
            'currency' => 'USD',
            'content_name' => 'Product ABC',
        ],
        request: $request, // Current HTTP request for IP, UA, cookies
    )
);
```

The conversion will be created with:

- **Status**: `Queued` (pending processing)
- **Client IP**: Automatically captured from request
- **User Agent**: Automatically captured from request
- **Meta Data**: Facebook pixel cookies (`_fbp`, `_fbc`) if available
- **Source URL**: Page where conversion occurred

### 4. Retrieving Unsaved Conversions

[](#4-retrieving-unsaved-conversions)

Get conversions that haven't been saved yet (useful for batch processing):

```
use Carbon\Carbon;

$unsavedConversions = $trackerService->getUnsavedConversionByPixelEvent(
    $eventId,
    Carbon::now()->subDay()
);

// Returns grouped conversions by date for processing
foreach ($unsavedConversions as $date => $conversions) {
    // Process conversions for each date
    foreach ($conversions as $conversion) {
        // Handle conversion
    }
}
```

### 5. Conversion Summaries

[](#5-conversion-summaries)

Generate daily conversion summaries using the provided command:

```
php artisan taut-tracker:create-conversion-summary
```

Or trigger programmatically:

```
use TautId\Tracker\Services\PixelSummaryService;

$summaryService = app(PixelSummaryService::class);
// Generate summaries (typically called via queue job)
```

Events &amp; Queue Processing
-----------------------------

[](#events--queue-processing)

The package fires a `ConversionCreateEvent` when conversions are created. To process conversions and send them to ad platforms, you need to run Laravel's queue worker:

```
use TautId\Tracker\Events\ConversionCreateEvent;

Event::listen(ConversionCreateEvent::class, function (ConversionCreateEvent $event) {
    // Handle conversion creation
    $conversion = $event->conversion;
    // Send to ad platform, log, etc.
});
```

**Start the queue worker to process events:**

```
# Using queue:work
php artisan queue:work

# Or using Horizon for a dashboard UI
php artisan horizon
```

The status of conversions (`Queued`, `Success`, `Failed`, `Duplicate`) is managed internally by the package through event listeners and queue jobs.

Data Structures
---------------

[](#data-structures)

### PixelEventData

[](#pixeleventdata)

```
class PixelEventData {
    public string $id;
    public string $name;
    public string $driver;
    public string $event;
    public string $pixel_id;
    public string $token;
    public ?string $reference_type;
    public ?string $reference_id;
    public Carbon $created_at;
    public Carbon $updated_at;
}
```

### PixelTrackerData

[](#pixeltrackerdata)

```
class PixelTrackerData {
    public string $id;
    public array $pixel;           // PixelEvent data
    public string $status;         // Queued, Success, Failed, Duplicate
    public bool $is_saved;
    public array $data;            // Conversion data
    public array $meta;            // Driver-specific metadata
    public string $user_agent;
    public string $client_ip;
    public string $source_url;
    public Carbon $created_at;
    public Carbon $updated_at;
}
```

Supported Drivers
-----------------

[](#supported-drivers)

### Meta (Facebook) Driver

[](#meta-facebook-driver)

The Meta driver automatically captures Facebook pixel cookies and validates conversion data:

```
'data' => [
    'value' => 99.99,              // Conversion value
    'currency' => 'USD',            // Currency code
    'content_name' => 'Product',    // Item name
    'content_ids' => ['id1', 'id2'], // Optional: item IDs
    'content_type' => 'product',     // Optional: content type
]
```

Captured metadata:

- `fbp`: Facebook browser pixel ID
- `fbc`: Facebook click ID

Advanced Usage
--------------

[](#advanced-usage)

### Custom Filtering

[](#custom-filtering)

Use the `FilterServiceTrait` for advanced filtering on pixel events:

```
use TautId\Tracker\Traits\FilterServiceTrait;

// Available filters: search, sort, date ranges, etc.
$filtered = $service->getPaginatedPixelEvents($filterData);
```

Database Models
---------------

[](#database-models)

The package provides three main MongoDB models:

- **PixelEvent** - Defines what to track
- **PixelTracker** - Individual conversion records
- **PixelSummary** - Aggregated conversion summaries

All models use MongoDB for scalability and flexibility.

Testing
-------

[](#testing)

Run the test suite:

```
composer test
```

Run tests with coverage:

```
composer test-coverage
```

Troubleshooting
---------------

[](#troubleshooting)

### MongoDB Connection Issues

[](#mongodb-connection-issues)

Ensure MongoDB is running and the connection string is correct:

```
# Test connection
mongosh "mongodb://localhost:27017"
```

### Missing Conversions

[](#missing-conversions)

Check the conversion status:

- `Queued` - Waiting for processing
- `Success` - Sent to platform
- `Failed` - Failed to send
- `Duplicate` - Duplicate conversion

### Event Listener Not Triggered

[](#event-listener-not-triggered)

Ensure the package is registered in `config/app.php` and service provider is loaded:

```
php artisan package:discover
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [tautid](https://github.com/tautid)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance59

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/506bcd38fef1c18b6357f2d835cc3b89a6afb10fe47eed6908e0a8b528151521?d=identicon)[rezzakurniawan](/maintainers/rezzakurniawan)

---

Top Contributors

[![Axwraith](https://avatars.githubusercontent.com/u/68546905?v=4)](https://github.com/Axwraith "Axwraith (18 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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