components/CiiAnalytics.php
public function init()
    {
        parent::init();
	if (get_class(Yii::app()) != "CConsoleApplication")
	{
		$asset = Yii::app()->assetManager->publish(__DIR__.DS.'..'.DS.'assets'.DS.'dist', true, -1, YII_DEBUG);
		$cs    = Yii::app()->getClientScript();

		$cs->registerScriptFile($asset.(YII_DEBUG ? '/ciianalytics.js' : '/ciianalytics.min.js'));

		$cs->registerScript('ciianalytics', 'ciianalytics.init();');
	}
    }
public function init()
    {
        parent::init();
	if (get_class(Yii::app()) != "CConsoleApplication")
	{
		$asset = Yii::app()->assetManager->publish(__DIR__.DS.'..'.DS.'assets'.DS.'dist', true, -1, YII_DEBUG);
		$cs    = Yii::app()->getClientScript();

		$cs->registerScriptFile($asset.(YII_DEBUG ? '/ciianalytics.js' : '/ciianalytics.min.js'));

		$cs->registerScript('ciianalytics', 'ciianalytics.init();');
	}
    }
public function init ( ) { parent :: init ( ) ; if ( get_class ( Yii :: app ( ) ) != "CConsoleApplication" ) { $ asset = Yii :: app ( ) -> assetManager -> publish ( __DIR__ . DS . '..' . DS . 'assets' . DS . 'dist' , true , - 1 , YII_DEBUG ) ; $ cs = Yii :: app ( ) -> getClientScript ( ) ; $ cs -> registerScriptFile ( $ asset . ( YII_DEBUG ? '/ciianalytics.js' : '/ciianalytics.min.js' ) ) ; $ cs -> registerScript ( 'ciianalytics' , 'ciianalytics.init();' ) ; } }
Init function overloaded to inject CiiAnalytics JS Tracking
Init function overloaded to inject CiiAnalytics JS Tracking