Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomlutzenberger/yii2-googleanalytics
Yii2 Widget for Google Analytics
https://github.com/tomlutzenberger/yii2-googleanalytics
google google-analytics php publish-website tracking yii2 yii2-extension yii2-widget
Last synced: 2 days ago
JSON representation
Yii2 Widget for Google Analytics
- Host: GitHub
- URL: https://github.com/tomlutzenberger/yii2-googleanalytics
- Owner: tomlutzenberger
- License: mit
- Created: 2019-11-27T08:22:17.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-20T07:52:21.000Z (5 months ago)
- Last Synced: 2024-08-30T13:49:13.591Z (3 months ago)
- Topics: google, google-analytics, php, publish-website, tracking, yii2, yii2-extension, yii2-widget
- Language: PHP
- Homepage:
- Size: 129 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
![Yii2 Google Analytics](logo.png)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/tomlutzenberger/yii2-googleanalytics)
![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/tomlutzenberger/yii2-googleanalytics)
![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/tomlutzenberger/yii2-googleanalytics)
![Packagist Downloads](https://img.shields.io/packagist/dt/tomlutzenberger/yii2-googleanalytics)
![Lines of code](https://img.shields.io/tokei/lines/github/tomlutzenberger/yii2-googleanalytics)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=tomlutzenberger_yii2-googleanalytics&metric=alert_status)](https://sonarcloud.io/dashboard?id=tomlutzenberger_yii2-googleanalytics)
![Maintenance](https://img.shields.io/maintenance/yes/2022)Yii2 GoogleAnalytics
=====================
Yii2 Widget for Google AnalyticsInstallation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist tomlutzenberger/yii2-googleanalytics "*"
```or add
```
"tomlutzenberger/yii2-googleanalytics": "*"
```to the required section of your `composer.json` file.
Usage
-----Once the extension is installed, simply use it in your code by:
```php
= \TomLutzenberger\GoogleAnalytics\GoogleAnalytics::widget() ?>
```You can either add the ID of your container to the `params.php`
```php
YII_ENV_PROD ? 'UA-1234567-01' : '',
];
```or pass it
directly to the widget:```php
= \TomLutzenberger\GoogleAnalytics\GoogleAnalytics::widget([
'gaId' => 'UA-1234567-01'
]) ?>
```License
-----
This package is published under the MIT License and can be used for any
commercial and personal projects.