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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nanuc/laravel-track

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

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 today

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 47% 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

1960d 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

[jamesmills/laravel-timezone

Timezone storage and retrieval for Laravel

695779.9k13](/packages/jamesmills-laravel-timezone)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[open-southeners/laravel-companion-apps

Extend your Laravel applications with companions apps (Android, iOS, PWA...)

234.4k](/packages/open-southeners-laravel-companion-apps)[cleaniquecoders/shrinkr

Shrinkr is a Laravel package for shortening URLs, with custom slugs, analytics, branded domains, and seamless API integration.

155.5k](/packages/cleaniquecoders-shrinkr)[chowjiawei/laravel-help-plugin

Integrating useful auxiliary functions into laravel,Assistant tools based on laravel.

671.7k](/packages/chowjiawei-laravel-help-plugin)[outhebox/nova-fields-agent

This field give the ability to hide fields from your resources table on mobile screens for a better responsive concept

101.1k](/packages/outhebox-nova-fields-agent)

PHPackages © 2026

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