PHPackages                             nanuc/laravel-track - 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. nanuc/laravel-track

ActiveLibrary

nanuc/laravel-track
===================

1.0.9(5y ago)066PHPPHP ^8.0

Since Feb 13Pushed 5y agoCompare

[ Source](https://github.com/nanuc/laravel-track)[ Packagist](https://packagist.org/packages/nanuc/laravel-track)[ RSS](/packages/nanuc-laravel-track/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (11)Used By (0)

This package adds content marketing tracking and A/B tests to your app. The package tries to find a balance between privacy and useful data. All users will be anonymized, so by default there is no way to trace back a user.

Every user receives a random string which is stored in a cookie to identify them on the following visits.

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

[](#installation)

`composer require nanuc/laravel-track`

#### Publish config (optional)

[](#publish-config-optional)

`php artisan vendor:publish --provider="Nanuc\LaravelTrack\LaravelTrackServiceProvider" --tag=config`

You can configure a separate database connection.

#### Run migrations

[](#run-migrations)

Run `php artisan migrate` to create the necessary tables.

Usage
-----

[](#usage)

### Middleware

[](#middleware)

Just add the middleware `track` to the routes you want to track.

### UTM

[](#utm)

The package tracks the `utm_campaign` and `utm_source` query parameters. Nothing you need to do here.

### Goals

[](#goals)

Set reached goals with `Tracker::goal('goalName');`. You don't need to define the goals - they will be created on the first use.

If the route where you attach a goal is not tracked (e.g. in Livewire routes) the goal will be attached to the last known page view for this visitor.

#### Goals in views

[](#goals-in-views)

You can set goals in views too. They will be reached when the place where the component was placed gets visible in the view port. This can be used e.g. to measure if an A/B tested heroshot gets scrolls further down the page.

Just use `` in your blade view. For this to work you need to have a stack `scripts` in your layout - the name can be configured (`laravel-track.goals.component.stack-name`).

### Page name

[](#page-name)

As Laravel Livewire uses the same routes for different actions it might be useful to give a page a name. You can do this with `Tracker::page('pageName');`.

### A/B tests

[](#ab-tests)

Use the following syntax in your blade views:

```
@ab('logo', 'blue')

@endab
@ab('logo', 'green')

@endab
@ab('logo', 'red')

@endab
```

You don't need to define the A/B tests' name and options - they will be created on the first use. Options will be rotated on each visit.

Dashboard
---------

[](#dashboard)

This package offers a module for [LaravelAdmin](https://github.com/laravel-admin). To use it make sure to install LaravelAdmin first. Afterwards add `\Nanuc\LaravelTrack\LaravelAdmin\LaravelAdmin::class` to `config/laravel-admin`:

```
'modules' => [
    ...
    \Nanuc\LaravelTrack\LaravelAdmin\LaravelAdmin::class,
]

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

10

Last Release

1909d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9dd4066526f273592da88a5b863d5302bb171dd626ffd3e646a0f282a0dc4db2?d=identicon)[oleloSebastian](/maintainers/oleloSebastian)

### Embed Badge

![Health badge](/badges/nanuc-laravel-track/health.svg)

```
[![Health](https://phpackages.com/badges/nanuc-laravel-track/health.svg)](https://phpackages.com/packages/nanuc-laravel-track)
```

###  Alternatives

[cagilo/cagilo

A set of open-source Blade components for the Laravel Framework

172996.5k](/packages/cagilo-cagilo)[joaopaulolndev/filament-edit-profile

Filament package to edit profile

250258.1k34](/packages/joaopaulolndev-filament-edit-profile)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[laravel-enso/core

Main requirement &amp; dependency aggregator for Laravel Enso

3463.6k138](/packages/laravel-enso-core)

PHPackages © 2026

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