Lithium library for sending statistical data to Mixpanel.
{
"require" : {
"KeyteqLabs/li3_mixpanel" : "*"
}
}
composer.phar install
Add a submodule to your li3 libraries:
git submodule add [email protected]:KeyteqLabs/li3_mixpanel.git libraries/li3_mixpanel
Add this to your app (config/bootstrap/libraries.php):
<?php
Libraries::add('li3_mixpanel', array(
'token' => $token
));
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')
));
<?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
));