PHPackages                             okatsuralau/cakephp-mixpanel - 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. okatsuralau/cakephp-mixpanel

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

okatsuralau/cakephp-mixpanel
============================

CakePHP plugin providing easy integration with Mixpanel's analytics

v1.0.4(9y ago)0361MITPHPPHP &gt;=5.6

Since May 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/gabrielslau/CakePHP-Mixpanel)[ Packagist](https://packagist.org/packages/okatsuralau/cakephp-mixpanel)[ Docs](https://github.com/okatsuralau/CakePHP-Mixpanel)[ RSS](/packages/okatsuralau-cakephp-mixpanel/feed)WikiDiscussions master Synced 2w ago

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

 [ ![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265) ](LICENSE.txt) [ ![Build Status](https://camo.githubusercontent.com/5ea60bd5af114a3ec7aff37edd1591d95e226251628a4c80089206b089b1fe77/68747470733a2f2f696d672e736869656c64732e696f2f636f6465736869702f62326339663939302d316336342d303133352d323030622d3032303131306431303266302e7376673f7374796c653d666c61742d737175617265) ](https://app.codeship.com/projects/220010) [ ![Build Status](https://camo.githubusercontent.com/24d2b6da516acefee66af6cd86df5df8285ea46c8a10d301168f0771a0ee6f4b/68747470733a2f2f6170702e636f6465736869702e636f6d2f70726f6a656374732f34376461323366302d316338342d303133352d383230622d3536613463623537636565342f7374617475733f6272616e63683d6d6173746572267374796c653d666c61742d737175617265) ](https://app.codeship.com/projects/220010) [ ![Latest Stable Version](https://camo.githubusercontent.com/98b4637c6c57ab1f3c84eb41dd10834b74960180da134245b7aceb4db6876e64/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6b6174737572616c61752f63616b657068702d6d697870616e656c2e7376673f7374796c653d666c61742d737175617265266c6162656c3d737461626c65) ](https://packagist.org/packages/okatsuralau/cakephp-mixpanel)

CakePHP Mixpanel Plugin
=======================

[](#cakephp-mixpanel-plugin)

This plugin provides a Mixpanel component to track events from your controllers using the official [Mixpanel PHP library](https://github.com/mixpanel/mixpanel-php).

Requirements
------------

[](#requirements)

- PHP &gt;= 5.6
- CakePHP &gt;= 3.0

How to Install
--------------

[](#how-to-install)

```
composer require okatsuralau/cakephp-mixpanel@1.0.0

```

How to Use
----------

[](#how-to-use)

Load the plugin in your `config/bootstrap.php` file:

```
Plugin::load('CakephpMixpanel');

```

Add the plugin configurations in your `config/app.php` or `config/app_custom.php` file:

```
return [
    //...

    'Mixpanel' => [
        'token' => YOUR_TOKEN_HERE
    ]
]
```

Load the component in your `src/Controller/AppController.php`

```
public function initialize()
{
    parent::initialize();

    $this->loadComponent('CakephpMixpanel.Mixpanel');
}
```

and (optionally) add the following code to your `beforeFilter()` method to identify the users actions

```
public function beforeFilter(\Cake\Event\Event $event)
{
    // if a user is logged in
    $this->Mixpanel->identify($user_id);
    $this->Mixpanel->name_tag($user_name);
    $this->Mixpanel->register($superProperties);

    /* To make use of the people API */
    $this->Mixpanel->people($this->Auth->user('id'), array(
        '$username' => $this->Auth->user('username'),
        '$email' => $this->Auth->user('email'),
        '$created' => $this->Auth->user('created'),
        '$last_login' => $this->Auth->user('connected'),
        'my_custom_var' => $my_custom_var,
    ));

    // ...

    parent::beforeFilter($event);
}
```

To register an event, put the following code in your controller action. `src/Controller/PostController.php`

```
public function index()
{
    // ...

    $this->Mixpanel->track(
        'Post list',
        [
            'author' => $this->Auth->user('name'),
            'category' => 'Post',
        ]
    );
}

public function create()
{
    if ($this->request->is('post')) {

        // ...

        $this->Mixpanel->track(
            'Post Created',
            [
                'author' => $this->Auth->user('name'),
                'category' => 'Post',
            ]
        );

        $this->redirect(array('action'=>'index'));
    }
}
```

This should be enough to start sending events to Mixpanel.

License
-------

[](#license)

Copyright 2017 Gabriel Lau

Available for you to use under the MIT license. See:

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity62

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 ~1 days

Total

5

Last Release

3337d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32056034?v=4)[devlau](/maintainers/devlau)[@devlau](https://github.com/devlau)

---

Tags

analytics-trackingcakephpcomponentembedhelperjavascriptmixpanelphp56cakephpmixpanel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/okatsuralau-cakephp-mixpanel/health.svg)

```
[![Health](https://phpackages.com/badges/okatsuralau-cakephp-mixpanel/health.svg)](https://phpackages.com/packages/okatsuralau-cakephp-mixpanel)
```

###  Alternatives

[mixpanel/mixpanel-php

The Official PHP library for Mixpanel

14116.7M25](/packages/mixpanel-mixpanel-php)[markstory/asset_compress

An asset compression plugin for CakePHP. Provides file concatenation and a flexible filter system for preprocessing and minification.

3701.1M15](/packages/markstory-asset-compress)[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

333972.2k49](/packages/dereuromark-cakephp-tools)[markstory/mini-asset

An asset compression library. Provides file concatenation and a flexible filter system for preprocessing and minification.

63770.7k3](/packages/markstory-mini-asset)[cakedc/enum

Enumeration list Plugin for CakePHP 5

30229.6k2](/packages/cakedc-enum)[josegonzalez/cakephp-environments

CakePHP plugin to handle environments-level configuration

4689.8k](/packages/josegonzalez-cakephp-environments)

PHPackages © 2026

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