sanyisasha/yii2-google-analytics

There is no license information available for the latest version (1.0) of this package.

A package to easily handle Google Analytics in Yii2 projects

Installs: 74

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Type:yii2-extension

1.0 2019-12-20 11:06 UTC

This package is auto-updated.

Last update: 2024-09-20 22:18:02 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
    ]
]