2017 © Pedro Peláez
 

library yii-yandex-metrika

Simple Yii widget to add YandexMetrika counter/informer on web-page

image

lexeo/yii-yandex-metrika

Simple Yii widget to add YandexMetrika counter/informer on web-page

  • Monday, October 13, 2014
  • by lexeo
  • Repository
  • 1 Watchers
  • 1 Stars
  • 768 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 6 % Grown

The README.md

yii-yandex-metrika

Simple Yii widget to add YandexMetrika counter/informer on web page, (*1)

Requirements

Developed and tested with Yii 1.1.14. Should work on all 1.1.x versions., (*2)

Usage

Basic

[php]
/* @var $this CController */
$this->widget('ext.yii-yandex-metrika.EYandexMetrikaWidget', array(
   'id' => 123456789, // 
   'clickMap' => true,
   'trackLinks' => true,
   'accurateTrackBounce' => true,
));

or, (*3)

[php]
/* config/main.php */
'components' => array(
    'widgetFactory' => array(
        'widgets' => array(
            'EYandexMetrikaWidget' => array(
                // you can disable it while working on local machine
                'enabled' => true, 
                'id' => 123456789,
                'clickMap' => true,
                'trackLinks' => true,
                'accurateTrackBounce' => true,

                'informerOptions' => array(
                    'backgroundColor' => '#427a4b', // hex color code
                    'textColor' => 1, // 0|1
                    'arrowColor' => 0, // 0|1
                    'dataType' => 'visits', // visits|pageviews|uniques
                    'type' => 1, // 0|1
                ),
            ),
        ),
    ),
),

/* view|layout file */

$this->widget('ext.yii-yandex-metrika.EYandexMetrikaWidget');

Render Informer

[php]
/* @var $this CController */
$this->widget('ext.yii-yandex-metrika.EYandexMetrikaWidget', array(
    'id' => 123456789,
   'informer' => true,
   'informerSize' => 1, // 1|2|3
   'informerDataType' => 'uniques',
    'informerArrowColor' => 1, // 0|1 
   // or
   'informerOptions' => array(
        'textColor' => 0,
        'backgroundColor' => '#b7b7b7',
        'size' => 2,
   ),
));

or, (*4)

[php]
/* config/main.php */
'components' => array(
    'widgetFactory' => array(
        'widgets' => array(
            'EYandexMetrikaWidget' => array(
                'id' => 123456789,
                // ...
                'informerOptions' => array(
                    'backgroundColor' => '#427a4b', // hex color code
                    'textColor' => 1, // 0|1
                    'arrowColor' => 0, // 0|1
                    'dataType' => 'pageviews',
                ),
            ),
        ),
    ),
),

/* view|layout file */

$this->widget('ext.yii-yandex-metrika.EYandexMetrikaWidget', array('informer' => true));

The Versions

13/10 2014

dev-master

9999999-dev

Simple Yii widget to add YandexMetrika counter/informer on web-page

  Sources   Download

The Requires

 

by Alexey Grishatkin

extension yii yandex metrika