PHPackages                             yiimaker/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. yiimaker/yii2-google-analytics

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

yiimaker/yii2-google-analytics
==============================

Google Analytics (Measurement Protocol)

1.0.0(9y ago)32.9k↓50%Apache-2.0PHP

Since Dec 4Pushed 9y ago3 watchersCompare

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

READMEChangelogDependencies (2)Versions (2)Used By (0)

Google Analytics (Measurement Protocol)
=======================================

[](#google-analytics-measurement-protocol)

Google Analytics (Measurement Protocol)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist yiimaker/yii2-google-analytics "*"

```

or add

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

```

to the require section of your `composer.json` file.

Example
-------

[](#example)

**Initialize**

```
$analytics = \Yii::createObject([
    'class' => \ymaker\google\analytics\mp\Analytics::className(),

    'v' => 1,                                       // Protocol version. Default value: 1
    'tid' => 'UA-XXXX-Y'                            // Tracking ID / Web Property ID
    'cid' => '35009a79-1a05-49d7-b876-2b884d0f825b' // Client ID. Random UUID (http://www.ietf.org/rfc/rfc4122.txt)
]);
```

**Usage**

```
/** @var yii\httpclient\Response $responce */
$responce = $analytics->send([
    't' => 'event',     // Hit Type.
    'ec' => 'video',    // Event Category.
    'ea' => 'play',     // Event Action.
    'el' => 'holiday',  // Event label.
    'ev' => 300,        // Event value.
]);
```

For more information, refer to the [API official documentation](https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3452d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/81dbf9eb881773e58a5472007499612c6e0c93007a75336688a1a21b9630dc1e?d=identicon)[YiiMaker](/maintainers/YiiMaker)

---

Top Contributors

[![trabem](https://avatars.githubusercontent.com/u/3384909?v=4)](https://github.com/trabem "trabem (4 commits)")

---

Tags

google-analyticsmeasurement-protocolyii2-extensiongoogleyii2extensionanalyticsmeasurement protocol

### Embed Badge

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

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

###  Alternatives

[cybercog/yii2-google-analytics

Google Analytics Widget for the Yii2 framework

1677.1k2](/packages/cybercog-yii2-google-analytics)[abei2017/yii2-wx

一个专注于yii2的微信sdk

1482.8k](/packages/abei2017-yii2-wx)[imanilchaudhari/yii2-currency-converter

This extension will help to find out current currency conversion rate.

2011.6k](/packages/imanilchaudhari-yii2-currency-converter)[degordian/yii2-webhooks

Yii2 extension for webhooks

117.1k](/packages/degordian-yii2-webhooks)

PHPackages © 2026

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