https://github.com/hiqdev/yii2-google-tag-manager
Google Tag Manager widget for Yii2 applications
https://github.com/hiqdev/yii2-google-tag-manager
hacktoberfest
Last synced: 11 months ago
JSON representation
Google Tag Manager widget for Yii2 applications
- Host: GitHub
- URL: https://github.com/hiqdev/yii2-google-tag-manager
- Owner: hiqdev
- License: bsd-3-clause
- Created: 2020-01-10T13:50:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-10T10:13:16.000Z (almost 6 years ago)
- Last Synced: 2025-05-27T15:47:37.137Z (about 1 year ago)
- Topics: hacktoberfest
- Language: PHP
- Size: 12.7 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yii2 Google Tag Manager
**Google Tag Manager widget for Yii2 applications**
[](https://packagist.org/packages/hiqdev/yii2-google-tag-manager)
[](https://packagist.org/packages/hiqdev/yii2-google-tag-manager)
[](https://travis-ci.org/hiqdev/yii2-google-tag-manager)
[](https://scrutinizer-ci.com/g/hiqdev/yii2-google-tag-manager/)
[](https://scrutinizer-ci.com/g/hiqdev/yii2-google-tag-manager/)
Provides really easy adding [Google Tag Manager] snippet 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_BEGIN_BODY] and echos the snippet.
[Google Tag Manager]: https://tagmanager.google.com/
[EVENT_BEGIN_BODY]: http://www.yiiframework.com/doc-2.0/yii-web-view.html#EVENT_BEGIN_BODY-detail
## Installation
The preferred way to install this yii2-extension is through [composer](http://getcomposer.org/download/).
Either run
```sh
php composer.phar require "hiqdev/yii2-google-tag-manager"
```
or add
```json
"hiqdev/yii2-google-tag-manager": "*"
```
to the require section of your composer.json.
## Configuration
This extension is supposed to be used with [composer-config-plugin].
Else look [config/web.php] for cofiguration example.
Available configuration parameters:
- `GoogleTagManager.id`
For more details please see [config/params.php].
[composer-config-plugin]: https://github.com/hiqdev/composer-config-plugin
[config/web.php]: config/web.php
[config/params.php]: config/params.php