keyteqlabs/li3_mixpanel

Lithium Mixpanel integration

Installs: 26

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 5

Forks: 2

Type:lithium-library

v1.0 2013-03-06 17:51 UTC

This package is not auto-updated.

Last update: 2024-12-15 04:10:12 UTC


README

Lithium library for sending statistical data to Mixpanel.

Installation

Composer

{
  "require" : {
    "KeyteqLabs/li3_mixpanel" : "*"
  }
}
composer.phar install

Submodule

Add a submodule to your li3 libraries:

git submodule add git@github.com:KeyteqLabs/li3_mixpanel.git libraries/li3_mixpanel

Activate it

Add this to your app (config/bootstrap/libraries.php):

<?php
Libraries::add('li3_mixpanel', array(
    'token' => $token
));

Filtering track calls by environment

Send the env key when adding the library to only enable one or a set of environments. Passing * means enabling it for every environment.

<?php
Libraries::add('li3_mixpanel', array(
    'token' => $token,
    'env' => array('production', 'staging')
));

Sending data

<?php
Mixpanel::track('api.requests', $params['request']->params);
// Track revenue
Mixpanel::transaction($userId, $sum);
// Track people by identifying the person
Mixpanel::set($userId, array(
    '$name' => $user->name,
    '$username' => $user->username
));

Credits