PHPackages                             mrustamzade/laravel-marketing-touchpoints - 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. mrustamzade/laravel-marketing-touchpoints

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

mrustamzade/laravel-marketing-touchpoints
=========================================

Laravel package to track marketing touchpoints and connect them to orders.

v1.0.1(3mo ago)04MITPHPPHP ^8.2

Since Mar 16Pushed 3mo agoCompare

[ Source](https://github.com/byrustamzade/prou-marketing)[ Packagist](https://packagist.org/packages/mrustamzade/laravel-marketing-touchpoints)[ RSS](/packages/mrustamzade-laravel-marketing-touchpoints/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Laravel Marketing Touchpoints
=============================

[](#laravel-marketing-touchpoints)

Track user marketing touchpoints (including UTM params) with a unique visitor token, then link the final order to that token after checkout.

Features
--------

[](#features)

- Generates a unique token cookie when a visitor arrives.
- Stores each touchpoint in DB with URL, path, referrer, UTM data, and request metadata.
- Links orders to the same visitor token after checkout.
- Supports custom order table and primary key resolution.
- Includes an admin route (`/marketing`) for viewing touchpoints by token or order ID.

Screenshot
----------

[](#screenshot)

[![Marketing Touchpoints Dashboard](docs/images/marketing-dashboard.png)](docs/images/marketing-dashboard.png)

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

[](#installation)

```
composer require mrustamzade/laravel-marketing-touchpoints
```

Publish config and migrations:

```
php artisan vendor:publish --tag=marketing-touchpoints-config
php artisan vendor:publish --tag=marketing-touchpoints-migrations
```

Run migrations:

```
php artisan migrate
```

Enable Tracking Middleware
--------------------------

[](#enable-tracking-middleware)

Option 1: Enable auto-injection in config:

```
'middleware' => [
    'auto_track_web' => true,
],
```

Option 2: Add alias manually to your routes/group:

```
Route::middleware(['web', 'track-touchpoints'])->group(function (): void {
    // your storefront routes
});
```

Link Order After Checkout
-------------------------

[](#link-order-after-checkout)

In checkout success flow:

```
use MRustamzade\MarketingTouchpoints\Facades\MarketingTouchpoints;

MarketingTouchpoints::linkOrder($order); // Eloquent model
```

Or scalar order ID:

```
MarketingTouchpoints::linkOrder($orderId);
```

Or pass full order reference:

```
MarketingTouchpoints::linkOrder([
    'table' => 'shop_orders',
    'primary_key' => 'uuid',
    'id' => $orderUuid,
]);
```

### Optional model trait

[](#optional-model-trait)

Add this to your order model to auto-link when created:

```
use MRustamzade\MarketingTouchpoints\Concerns\LinksMarketingTouchpoints;

class Order extends Model
{
    use LinksMarketingTouchpoints;
}
```

Order Table + Primary Key Resolution
------------------------------------

[](#order-table--primary-key-resolution)

The package resolves order reference in this order:

1. If you pass an Eloquent model to `linkOrder()`, it uses that model's table and key name.
2. Else if `orders.model` is configured, it loads table/key from that model.
3. Else it falls back to `orders.table` and `orders.primary_key`.

Set defaults in `config/marketing-touchpoints.php`:

```
'orders' => [
    'model' => App\Models\Order::class,
    'table' => 'orders',
    'primary_key' => 'id',
],
```

Admin Marketing Route
---------------------

[](#admin-marketing-route)

Default route:

- URL: `/marketing`
- middleware: `web`, `auth`
- filters: `?token={token}` or `?order_id={orderId}`

Customize from config:

```
'route' => [
    'prefix' => 'marketing',
    'middleware' => ['web', 'auth'],
],
```

Config Summary
--------------

[](#config-summary)

- `tables.visitors`, `tables.touchpoints`, `tables.conversions`
- `orders.model`, `orders.table`, `orders.primary_key`
- `middleware.except` to skip tracking admin/internal routes
- `track.only_with_utm` if you only want UTM-tagged touchpoints
- `track.dedupe_seconds` to skip identical rapid reloads (set `0` to disable)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance81

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

2

Last Release

103d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9193f271d622e6cb54f60d941768e33b3232be8a90a9c45fef830dd2d1834b1a?d=identicon)[byrustamzade](/maintainers/byrustamzade)

---

Top Contributors

[![mrustamzade](https://avatars.githubusercontent.com/u/125460601?v=4)](https://github.com/mrustamzade "mrustamzade (7 commits)")

### Embed Badge

![Health badge](/badges/mrustamzade-laravel-marketing-touchpoints/health.svg)

```
[![Health](https://phpackages.com/badges/mrustamzade-laravel-marketing-touchpoints/health.svg)](https://phpackages.com/packages/mrustamzade-laravel-marketing-touchpoints)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)[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)
