PHPackages                             ezoterik/yii2-google-tag-manager - 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. ezoterik/yii2-google-tag-manager

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

ezoterik/yii2-google-tag-manager
================================

Google Tag Manager extension for the Yii2 framework

2.3.0(1y ago)7355.3k↓71.3%4MITPHP

Since Mar 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ezoterik/yii2-google-tag-manager)[ Packagist](https://packagist.org/packages/ezoterik/yii2-google-tag-manager)[ RSS](/packages/ezoterik-yii2-google-tag-manager/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (1)Versions (13)Used By (0)

Google Tag Manager extension for the Yii2 framework
===================================================

[](#google-tag-manager-extension-for-the-yii2-framework)

[![Latest Stable Version](https://camo.githubusercontent.com/eb3d00ea5760fd2ebc4ad6255f12c8c865760756518700234419f0f3c3fed436/68747470733a2f2f706f7365722e707567782e6f72672f657a6f746572696b2f796969322d676f6f676c652d7461672d6d616e616765722f762f737461626c65)](https://packagist.org/packages/ezoterik/yii2-google-tag-manager)[![Total Downloads](https://camo.githubusercontent.com/1d4cf3948c71499378fe3f7397b62d237e7eef520ee90ccc0b4538b2410d561f/68747470733a2f2f706f7365722e707567782e6f72672f657a6f746572696b2f796969322d676f6f676c652d7461672d6d616e616765722f646f776e6c6f616473)](https://packagist.org/packages/ezoterik/yii2-google-tag-manager)[![Latest Unstable Version](https://camo.githubusercontent.com/d27adba774d7979c05192be0b6041485f412691e12f90eff21a73aca276d5a26/68747470733a2f2f706f7365722e707567782e6f72672f657a6f746572696b2f796969322d676f6f676c652d7461672d6d616e616765722f762f756e737461626c65)](https://packagist.org/packages/ezoterik/yii2-google-tag-manager)[![License](https://camo.githubusercontent.com/d1a97b63185e59b5a0502437a29b962002e39341f390d7e815be9e77e05ade94/68747470733a2f2f706f7365722e707567782e6f72672f657a6f746572696b2f796969322d676f6f676c652d7461672d6d616e616765722f6c6963656e7365)](https://packagist.org/packages/ezoterik/yii2-google-tag-manager)

Integration Google Tag Manager in your application

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist ezoterik/yii2-google-tag-manager "*"

```

or add

```
"ezoterik/yii2-google-tag-manager": "*"

```

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

Setup
-----

[](#setup)

Add this code in your *@app/config/main.php* config file with the other previous config:

```
'bootstrap' => ['googleTagManager'],
'components' => [
    'googleTagManager' => [
        'class' => 'ezoterik\googleTagManager\GoogleTagManager',
        'tagManagerId' => 'GOOGLE_TAG_MANAGER_ID', //Your Google Tag Manager ID without "GTM-" prefix
    ],
],
```

Usage
-----

[](#usage)

You can generate events:

```
Yii::$app->googleTagManager->dataLayerPushItemDelay('event', 'example_event');
```

Or push event as object:

```
Yii::$app->googleTagManager->dataLayerPushItem(null, (object)[
    'event' => 'view_item',
    'ecommerce' => (object)[
        'currency' => 'UAH',
        'value' => '500',
        'items' => [
            (object)[
                'item_name' => 'Product name',
                'item_id' => '12345',
                'price' => '500',
                'item_brand' => 'Analytics',
                'item_category' => 'Very Good Category',
                'item_category2' => 'Very Good Category 2',
                'item_category3' => 'Very Good Category 3',
                'item_category4' => 'Very Good Category 4',
                'item_variant' => 'full',
                'item_list_name' => 'sales',
                'item_list_id' => 'sales2022',
            ],
        ],
    ],
]);
```

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance46

Moderate activity, may be stable

Popularity42

Moderate usage in the ecosystem

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

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

Every ~305 days

Recently: every ~192 days

Total

12

Last Release

411d ago

Major Versions

1.3.0 → 2.0.02023-04-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/63a7179401d7e7ffd480c17674d9bc25a4156c5f31b7f10e7d499bfa7f5d2a81?d=identicon)[ezoterik](/maintainers/ezoterik)

---

Top Contributors

[![ezoterik](https://avatars.githubusercontent.com/u/1498377?v=4)](https://github.com/ezoterik "ezoterik (20 commits)")[![juanisorondo](https://avatars.githubusercontent.com/u/9666184?v=4)](https://github.com/juanisorondo "juanisorondo (1 commits)")

---

Tags

googleyii2extensionanalyticsGoogle Tag Managertag manager

### Embed Badge

![Health badge](/badges/ezoterik-yii2-google-tag-manager/health.svg)

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

###  Alternatives

[lexik/data-layer-bundle

Manipulate the Google Tag Manager Data Layer from your Symfony application.

14114.5k](/packages/lexik-data-layer-bundle)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1455.6k](/packages/dmstr-yii2-cookie-consent)[imanilchaudhari/yii2-currency-converter

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

2111.7k](/packages/imanilchaudhari-yii2-currency-converter)

PHPackages © 2026

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