Yii2 widget to add Yandex.Metrika counter on page
The preferred way to install this extension is through composer.
Either run
php composer.phar require "dkushnikov/yii2-yandex-metrika" "*"
or add
"dkushnikov/yii2-yandex-metrika" : "*"
to the require section of your application's composer.json
file.
use yii\widgets\YandexMetrikaCounter;
<?= YandexMetrikaCounter::widget(
[
'counterId' => 12345,
]
) ?>