kissmetrics-extension A simple wrapper around the KM metrics library to use with Yii

  1. Requirements
  2. Usage
  3. Resources

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


0 0
1 follower
Yii Version: 1.1
License: BSD-2-Clause
Category: Logging
Developed by: ajsharma
Created on: Mar 18, 2013
Last updated: 10 years ago

Related Extensions