akiraz2/yii2-stat Multi Statistic and Analytic Yii2 Module for your website. Yandex, Google, Liveinternet, Mail, Bigmir, Alexa, Hotlog, Rambler... (see full description)

Yii2 Multi Web Statistic Module Packagist Version Total Downloads Software License ΒΆ

  1. Features
  2. Installation
  3. Usage
  4. Development
  5. Support
  6. Contributing
  7. Licensing

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:

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 ΒΆ

  • Π²Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ внСшниС сСрвисы Π½Π° свой вкус, Π²Ρ‹Π±ΠΎΡ€ простым ΠΊΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ΠΌ модуля
  • Π΅ΡΡ‚ΡŒ собствСнная простая систСма сбора статистики
  • Π΄Π°Π½Π½Ρ‹Π΅ хранятся Π² ΠΎΡ‚Π΄Π΅Π»ΡŒΠ½ΠΎΠΉ Ρ‚Π°Π±Π»ΠΈΡ†Π΅ Π±Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ… ΠΈΠ»ΠΈ Π½Π° вашС усмотрСниС (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 ΒΆ

The preferred way to install this extension is through composer.

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 run

yii migrate --migrationPath=@akiraz2/stat/migrations
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 ΒΆ

//

Для ΠΏΠ΅Ρ€Π΅Ρ…ΠΎΠ΄Π° Π½Π° страницу статистики

Development ΒΆ

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 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 ΒΆ

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

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 ΒΆ

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

2 0
2 followers
603 downloads
Yii Version: 2.0
License: MIT
Category: Others
Developed by: akiraz2 akiraz2
Created on: Apr 25, 2018
Last updated: (not set)
Packagist Profile
Github Repository

Related Extensions