PHPackages                             akiraz2/yii2-stat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. akiraz2/yii2-stat

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

akiraz2/yii2-stat
=================

Multi Statistic and Analytic Yii2 Module for your website. Yandex, Google, Liveinternet, Mail, Bigmir, Alexa, Hotlog, Rambler, Openstat and Own stat by IP

0.3(6y ago)196073MITPHP

Since Apr 13Pushed 5y ago4 watchersCompare

[ Source](https://github.com/akiraz2/yii2-stat)[ Packagist](https://packagist.org/packages/akiraz2/yii2-stat)[ RSS](/packages/akiraz2-yii2-stat/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (7)Used By (0)

Yii2 Multi Web Statistic Module [![Packagist Version](https://camo.githubusercontent.com/78fdd52e3c4d705f56df23c30c7f40147746458b52499c70848ce34cc02ee0f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616b6972617a322f796969322d737461742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/akiraz2/yii2-stat) [![Total Downloads](https://camo.githubusercontent.com/0ceec52e634fca23779c2c8da51f7ef371cc134c5253b7f175e33c22097fc8d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616b6972617a322f796969322d737461742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/akiraz2/yii2-stat) [![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)
=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#yii2-multi-web-statistic-module---)

> **NOTE:** Module is in initial development. Anything may change at any time. На данный момент текущая рабочая версия v0.3 - есть только счетчики яндекса и google и собственный счетчик в DB

Statistics and Analytics module for your website. Many systems of your choice, connect either in the config module or in the admin panel:

- **Яндекс-Метрика**
- **Google Analytics**
- Liveinternet
- TopMail
- Bigmir *(для украинской аудитории)*
- Alexa
- Hotlog
- Rambler
- Openstat
- и даже на выбор **собственная** система для отслеживания посетителей по их IP-адресам и cookie.

To develop the Yii2 Stat module, the developments of these modules were used:

- [klisl/yii2-statistics](https://github.com/klisl/yii2-statistics) (inspired)
- [hiqdev/yii2-yandex-metrika](https://github.com/hiqdev/yii2-yandex-metrika) (code)

Sometimes not all site visits are recorded by Yandex or Google counters. To visit was accurately counted (and this is very important for tracking advertising sources), use server logs or in our case you can use the minimum working counter in PHP.

Features
--------

[](#features)

- вы можете использовать внешние сервисы на свой вкус, выбор простым конфигурированием модуля
- есть собственная простая система сбора статистики
- данные хранятся в отдельной таблице базы данных или на ваше усмотрение (*Redis*, etc)
- статистика формируется на основе уникальных IP адресов посетителей сайта/приложения и Cookie
- можно посмотреть страну, **город**, какой браузер и расширение, **referer**
- **источник перехода** (inner, search, direct, ads (from UTM-tags), unknown)
- **отсеивание поисковых ботов** (11шт)
- есть возможность добавления IP, которые не нужны в статистике, в черный спискок
- удобная фильтрация вывода результатов статистики (за день, период, по определенному IP)

What information is displayed for each individual visitor:

- its unique IP address with the ability to obtain information about its location
- URL of the page being viewed and number of clicks
- time to visit a particular page

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist akiraz2/yii2-stat "dev-master"

```

or add

```
"akiraz2/yii2-stat": "dev-master"

```

to the require section of your `composer.json` file.

### Migration

[](#migration)

Migration run

```
yii migrate --migrationPath=@akiraz2/stat/migrations
```

### Config

[](#config)

Config common modules in common/config/main.php

```
    'modules' => [
        'stat' => [
            'class' => akiraz2\stat\Module::class,
            'yandexMetrika' => [ // false by default
               'id' => 13788753,
               'params' => [
                   'clickmap' => true,
                   'trackLinks' => true,
                   'accurateTrackBounce' => true,
                   'webvisor' => true
               ]
            ],
            'googleAnalytics' => [ // false by default
                'id' => 'UA-114443409-2',
            ],
            'ownStat' => true, //false by default
            'ownStatCookieId' => 'yii2_counter_id', // 'yii2_counter_id' default
            'onlyGuestUsers' => true, // true default
            'countBot' => false, // false default
            'appId' => ['app-frontend'], // by default count visits only from Frontend App (in backend app we dont need it)
            'blackIpList' => [], // ['127.0.0.1'] by default

            // размещаем нашу админ панель на backend с проверкой доступа или ролями (здесь используется dektrium/user)
            'controllerMap' => [
                'dashboard' => [
                    'class' => 'akiraz2\stat\controllers\DashboardController',
                    'as access' => [
                        'class' => \yii\filters\AccessControl::class,
                        'rules' => [
                            [
                                'allow' => true,
                                'roles' => ['@'],
                                'matchCallback' => function () {
                                    return Yii::$app->user->identity->getIsAdmin();
                                },
                            ],
                        ],
                    ],
                ],
            ],
        ],
     ],
```

Usage
-----

[](#usage)

//

Для перехода на страницу статистики

- с включенным ЧПУ в настройках Вашего приложения: ****
- без ЧПУ: ****

Development
-----------

[](#development)

### TODO

[](#todo)

1. Optimize db usage (for inner db-counter)
2. Real dashboard, analytics
3. Remove unnecessary code from previous packages
4. Add other services (Hotlog, Openstat, etc)
5. Translate dashboard

Please translate to your language! Edit config `@vendor/akiraz2/yii2-stat/src/messages/config.php`, add your language and run script:

```
php ./yii message/extract @akiraz2/stat/messages/config.php
```

translate file will be in `@vendor/akiraz2/yii2-stat/src/messages/` or your configured path

Support
-------

[](#support)

If you have any questions or problems with Yii2-Stat you can ask them directly by using following email address: `akiraz@bk.ru`.

Contributing
------------

[](#contributing)

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome. +PSR-2 style coding.

I can apply patch, PR in 2-3 days! If not, please write me `akiraz@bk.ru`

Licensing
---------

[](#licensing)

Yii2-Stat is released under the MIT License. See the bundled [LICENSE.md](LICENSE.md)for details.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~81 days

Recently: every ~101 days

Total

6

Last Release

2553d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24400393?v=4)[akiraz2](/maintainers/akiraz2)[@akiraz2](https://github.com/akiraz2)

---

Top Contributors

[![akiraz2](https://avatars.githubusercontent.com/u/24400393?v=4)](https://github.com/akiraz2 "akiraz2 (13 commits)")[![gugoan](https://avatars.githubusercontent.com/u/1585443?v=4)](https://github.com/gugoan "gugoan (1 commits)")

---

Tags

countergoogle-analyticsstatisticsyandex-metrikayii2yii2-extensionyii2-modulesyii2-statisticsIPyii2modulestatisticsgoogle analyticyandex-metrikaopenstatbigmir

### Embed Badge

![Health badge](/badges/akiraz2-yii2-stat/health.svg)

```
[![Health](https://phpackages.com/badges/akiraz2-yii2-stat/health.svg)](https://phpackages.com/packages/akiraz2-yii2-stat)
```

###  Alternatives

[kartik-v/yii2-ipinfo

An IP address information display widget for Yii 2.0 with country flag and geo position info.

2832.6k1](/packages/kartik-v-yii2-ipinfo)[branchonline/yii2-lightbox

Lightbox widget for Yii2

13139.0k1](/packages/branchonline-yii2-lightbox)[akiraz2/yii2-ticket-support

Yii2 Support Ticket Module, easy, flexible, fast

611.7k](/packages/akiraz2-yii2-ticket-support)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
