Yii 1.1: kissmetrics-extension

A simple wrapper around the KM metrics library to use with Yii
1 follower

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',


Be the first person to leave a comment

Please to leave your comment.

Create extension
No downloadable files yet