sanyisasha / yii2-google-analytics
A package to easily handle Google Analytics in Yii2 projects
Installs: 75
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Type:yii2-extension
Requires
- php: >=7.2
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-10-20 22:32:06 UTC
README
A simple package, what insert GTAG code in your website with the given trackingId
.
Installion
composer require sanyisasha/yii2-google-analytics
or add
"sanyisasha/yii2-google-analytics": "*"
in your composer.json
file, the run composer install
Config
Example config
'bootstrap' => ['ga'], 'components' => [ 'ga' => [ 'class' => 'sanyisasha\yii2googleanalytics\components\Component', 'trackingId' => 'UA-XXXXXXXXX-XX', // GA code, you can find it in administration 'enabled' => YII_ENV_PROD, // bool or callable ] ]