andrewdanilov / yii2-yandex-metrika
Widget places yandex metrika counter
Package info
github.com/AndrewDanilov/yii2-yandex-metrika
Type:yii2-extension
pkg:composer/andrewdanilov/yii2-yandex-metrika
1.1.0
2022-01-05 12:43 UTC
Requires
- php: >=5.6.0
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2026-02-16 21:37:09 UTC
README
Widget places yandex metrika counter
Installation
The preferred way to install this extension is through composer.
Either run
composer require andrewdanilov/yii2-yandex-metrika "~1.1.0"
or add
"andrewdanilov/yii2-yandex-metrika": "~1.1.0"
to the require section of your composer.json file.
Usage
<?= \andrewdanilov\yandexmetrika\YandexMetrika::widget([ 'id' => 123456789, 'clickmap' => false, // default true 'trackLinks' => false, // default true 'accurateTrackBounce' => false, // default true 'webvisor' => false, // default true ]) ?>
If YII_ENV global constant is equal to 'dev' or widget param id is not set, then counter will be disabled and counter code will not be displayed.