Google Analytics extension for the Yii2 framework
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist porshkevich/yii2-google-analytics "*"
or add
"porshkevich/yii2-google-analytics": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
'ga'=>[
'class'=>'porshkevich\googleanalytics\GoogleAnalyticsAPI',
'defaultTrackingId' => 'UA-XXXXXXXX-X',
]