A simple wrapper for using the KISSMetrics php library with Yii
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



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.


  • Yii 1.1.12+
  • An account with KISSMetrics


  1. Place the metrics folder into your extensions.
  2. Add the following to your components block 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,
  1. To record an event, simply call Yii::app()->metrics->record(...) as you would KM::record(...), but with an additional optional parameter for your user identity flag.
Yii::app()->metrics->record('myEventId', array(
    'myEventKey1' => 'myEventValue1',
    'myEventKey2' => 'myEventValue2',