PHPackages                             hiqdev/yii2-google-analytics - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hiqdev/yii2-google-analytics

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

hiqdev/yii2-google-analytics
============================

Google Analytics tracking widget for Yii2 applications

21.9k2PHP

Since Jul 10Pushed 5y ago2 watchersCompare

[ Source](https://github.com/hiqdev/yii2-google-analytics)[ Packagist](https://packagist.org/packages/hiqdev/yii2-google-analytics)[ RSS](/packages/hiqdev-yii2-google-analytics/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 Google Analytics
=====================

[](#yii2-google-analytics)

**Google Analytics tracking widget for Yii2 applications**

[![Latest Stable Version](https://camo.githubusercontent.com/64b1a5501a066b9ff4e30dae310d3bfcf53827ca370610f44c16c68607592fd8/68747470733a2f2f706f7365722e707567782e6f72672f6869716465762f796969322d676f6f676c652d616e616c79746963732f762f737461626c65)](https://packagist.org/packages/hiqdev/yii2-google-analytics)[![Total Downloads](https://camo.githubusercontent.com/ed6b13fdff94fce8bdd0e8b1bb0f59e74b53a00e7b2d128095b2f4c1bf78a2e2/68747470733a2f2f706f7365722e707567782e6f72672f6869716465762f796969322d676f6f676c652d616e616c79746963732f646f776e6c6f616473)](https://packagist.org/packages/hiqdev/yii2-google-analytics)[![Build Status](https://camo.githubusercontent.com/aa349a258da056d34f4c6b3f1684c30a1c80886bfdc69ef3726c2cc1db7fb414/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6869716465762f796969322d676f6f676c652d616e616c79746963732e737667)](https://travis-ci.org/hiqdev/yii2-google-analytics)[![Scrutinizer Code Coverage](https://camo.githubusercontent.com/1638944de31c626b1254474b44c9157a3434fa4829d423a575b0c7034731d8d8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6869716465762f796969322d676f6f676c652d616e616c79746963732e737667)](https://scrutinizer-ci.com/g/hiqdev/yii2-google-analytics/)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/342b6b984165bc3796027896c339d26e72c91818276bbdcce2bfca636b15974d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6869716465762f796969322d676f6f676c652d616e616c79746963732e737667)](https://scrutinizer-ci.com/g/hiqdev/yii2-google-analytics/)[![Dependency Status](https://camo.githubusercontent.com/1a199f9f7625f3f53a84b208940c480e5d814a260fb4a4fa6051e3b595b667f2/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f6869716465763a796969322d676f6f676c652d616e616c79746963732f6465762d6d61737465722f62616467652e737667)](https://www.versioneye.com/php/hiqdev:yii2-google-analytics/dev-master)

Provides really easy adding [Google Analytics](https://analytics.google.com/) tracking widget to a site. Even easier then adding a widget into a site layout.

Works by adding Behavior to the Application View. Behavior listens to [EVENT\_END\_BODY](http://www.yiiframework.com/doc-2.0/yii-web-view.html#EVENT_END_BODY-detail) and echos the counter script.

Installation
------------

[](#installation)

The preferred way to install this yii2-extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require "hiqdev/yii2-google-analytics"
```

or add

```
"hiqdev/yii2-google-analytics": "*"
```

to the require section of your composer.json.

Configuration
-------------

[](#configuration)

This extension is supposed to be used with [composer-config-plugin](https://github.com/hiqdev/composer-config-plugin).

Else look [src/config/web.php](src/config/web.php) for cofiguration example.

Available configuration parameters:

- `googleAnalytics.id`
- `googleAnalytics.params`

For more details please see [src/config/params.php](src/config/params.php).

License
-------

[](#license)

This project is released under the terms of the BSD-3-Clause [license](LICENSE). Read more [here](http://choosealicense.com/licenses/bsd-3-clause).

Copyright © 2017, HiQDev ()

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 57.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/790fd24da129907d373559f60c6994f664f06e3f518502c03580cc9f3594615e?d=identicon)[hiqdev](/maintainers/hiqdev)

---

Top Contributors

[![hiqsol](https://avatars.githubusercontent.com/u/11820365?v=4)](https://github.com/hiqsol "hiqsol (4 commits)")[![strorch](https://avatars.githubusercontent.com/u/23340907?v=4)](https://github.com/strorch "strorch (2 commits)")[![SilverFire](https://avatars.githubusercontent.com/u/4499203?v=4)](https://github.com/SilverFire "SilverFire (1 commits)")

---

Tags

hacktoberfest

### Embed Badge

![Health badge](/badges/hiqdev-yii2-google-analytics/health.svg)

```
[![Health](https://phpackages.com/badges/hiqdev-yii2-google-analytics/health.svg)](https://phpackages.com/packages/hiqdev-yii2-google-analytics)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
