andrewdanilov/yii2-yandex-metrika

Widget places yandex metrika counter

1.1.0 2022-01-05 12:43 UTC

This package is auto-updated.

Last update: 2024-04-16 17:47:59 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.