keyteqlabs / li3_mixpanel
Lithium Mixpanel 集成
v1.0
2013-03-06 17:51 UTC
Requires
- php: >=5.3.2
Requires (Dev)
- composer/installers: *
- unionofrad/lithium: dev-dev
This package is not auto-updated.
Last update: 2024-09-22 02:53:54 UTC
README
Lithium 库,用于将统计数据发送到 Mixpanel。
安装
Composer
{ "require" : { "KeyteqLabs/li3_mixpanel" : "*" } }
composer.phar install
子模块
将子模块添加到你的 li3 库
git submodule add git@github.com:KeyteqLabs/li3_mixpanel.git libraries/li3_mixpanel
激活它
将此内容添加到你的应用中(config/bootstrap/libraries.php)
<?php Libraries::add('li3_mixpanel', array( 'token' => $token ));
按环境过滤跟踪调用
在添加库时发送 env
键,仅启用一个或一组环境。传递 *
表示为所有环境启用。
<?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 ));