KISSMetrics is a paid SAAS analytics product designed to track event occurring in your application. This extension wraps around their open-source PHP library and makes it a little easier to use with Yii.
Requirements ¶
- Yii 1.1.12+
- An account with KISSMetrics
Usage ¶
- Place the metricsfolder into your extensions.
- Add the following to your componentsblock in your config file.
'metrics' => array(
    'class' => 'ext.metrics.Metrics',
    'enabled' => true,
    'key' => "", // secret key for your KISSmetrics account
    'log_dir' => dirname(__FILE__).DIRECTORY_SEPARATOR.'../runtime/',
    'to_stderr' => true,
    'use_cron' => false,
),
- To record an event, simply call Yii::app()->metrics->record(...)as you wouldKM::record(...), but with an additional optional parameter for your user identity flag.
Yii::app()->metrics->record('myEventId', array(
    'myEventKey1' => 'myEventValue1',
    'myEventKey2' => 'myEventValue2',
    ...
));
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.