PHPackages                             codeaken/laravel-piwiktracker - 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. codeaken/laravel-piwiktracker

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

codeaken/laravel-piwiktracker
=============================

Insertion of Piwik tracking code and a hidden mode for hiding your tracking server url

1.0(11y ago)3100[1 issues](https://github.com/codeaken/laravel-piwiktracker/issues)MITPHPPHP &gt;=5.4.0

Since Aug 15Pushed 11y ago1 watchersCompare

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

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

Laravel Piwik Tracker
=====================

[](#laravel-piwik-tracker)

This Laravel 4 package allows you to **insert the Piwik tracking code** in your templates with the new Blade directive `@piwiktracker`.

It also has a feature that will **allow you to hide your Piwik server URL** by using the included proxy. This is great if you do not want anyone to find all of your sites by searching for the Pwik server URL.

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

[](#installation)

Require the package in your **composer.json** and then run `composer update`

```
"require": {
    ...
    "codeaken/laravel-piwiktracker": "1.*"
    ...
},

```

After updating composer, add the Service Provider to the `providers` array in `app/config/app.php`

```
'providers' => array(
    ...
    'Codeaken\PiwikTracker\ServiceProvider',
    ...
),

```

Also add the Facade to the `aliases` array in `app/config/app.php`

```
'aliases' => array(
    ...
    'PiwikTracker' => 'Codeaken\PiwikTracker\Facade',
    ...
),

```

The tracker is disabled by default so you need to copy the configuration file and enable it

```
$ php artisan config:publish codeaken/laravel-piwiktracker

```

Configuration file
------------------

[](#configuration-file)

- `enabled`: Allows you to enable or disable the insertion of the tracking code. Useful for when you are developing your site and dont need the visits tracked. Default is `false`.
- `site_id`: Id of the site you are tracking. You can find this id in the Piwik settings under Tracking Code. Default is `0`.
- `tracker_url`: URL to the Piwik server. Should only be the hostname without the schema, for example **mypiwik.com**. You can add an additional path if your have installed the Piwik server in a sub-directory, for example **mypiwik.com/piwik**. Default is an empty string.
- `hidden`: Set this to true if you want to hide the Piwik server url. We will then proxy all the requests to the `tracker_url`. This requires that you set a Piwik authorization token in the `token` option. Default is `false`.
- `token`: A Piwik authorization token for a user that has access to the site that you want to track. Only used if `hidden` is set to `true`. Default is an empty string.

Adding the tracking code
------------------------

[](#adding-the-tracking-code)

In your layout (or any other template) add the new Blade directive `@piwiktracker` before the `` tag and the tracking code should display if you have set `enabled` to `true` in the configuration file (and also set a valid `site_id` and `tracker_url`).

Hidden tracker URL
------------------

[](#hidden-tracker-url)

The Piwik Tracker Package has a feature of **hiding the Piwik server URL** (`tracker_url` in the config). You enable it by setting `hidden` to `true` and adding a valid token.

The request for the Piwik javascript will then go to the route `piwiktracker/js` and we will fetch the javascript (and cache it) from the Piwik server and return it.

The actual tracking call will go to `piwiktracker/php` where we add the pageview via the Piwik API by using the `token` in the config. We also return the 1x1 gif file.

License
-------

[](#license)

Laravel Piwik Tracker is licensed under the [MIT License](http://opensource.org/licenses/MIT).

Copyright 2014 Magnus Johansson

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

4284d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravelpiwiktrackinganalytics

### Embed Badge

![Health badge](/badges/codeaken-laravel-piwiktracker/health.svg)

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

###  Alternatives

[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

205144.8k5](/packages/bezhansalleh-filament-google-analytics)[cornford/googlitics

An easy way to integrate Google Analytics with Laravel.

3310.2k](/packages/cornford-googlitics)[panakour/analytics

Get whatever data you want from google analytics.

267.6k](/packages/panakour-analytics)[ohseesoftware/laravel-server-analytics

Server side analytics for your Laravel application or website.

1421.2k1](/packages/ohseesoftware-laravel-server-analytics)

PHPackages © 2026

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