lucidtaz / yii2-analytics
Yii2 bindings for lucidtaz/analytics
dev-master
2016-09-14 15:33 UTC
Requires
- php: >=7.0.0
- lucidtaz/analytics: dev-master
- yiisoft/yii2: ^2.0
Requires (Dev)
- phpunit/phpunit: ^5.5
This package is auto-updated.
Last update: 2025-01-12 05:48:01 UTC
README
Yii2 bindings for LucidTaZ/Analytics.
USAGE
Include the package using Composer:
composer require "lucidtaz/yii2-analytics"
Then configure web.php
and console.php
to include the module:
$config = [ ... 'bootstrap' => ['analytics'], 'modules' => [ 'analytics' => [ 'class' => 'lucidtaz\analytics\yii2\Module', 'db' => /* optional db specification */, ], ... ], ... ];
Create the tables, during installation, by running the migration:
php yii migrate --migrationPath=@vendor/lucidtaz/yii2-analytics/src/migrations
FUNCTIONALITY
To easily track all pageviews of a Controller, use the PageviewBehavior:
public function behaviors() { return [ 'pageview' => [ 'class' => 'lucidtaz\analytics\yii2\behaviors\PageviewBehavior', ], ]; }