Skip to content

KeyteqLabs/li3_mixpanel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

li3_mixpanel

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 [email protected]: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

About

lithium plugin for sending data to mixpanel

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%