Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vitorbizarra/laravel-gtag
An package to easily setup Google gtag in Laravel apps
https://github.com/vitorbizarra/laravel-gtag
analytics composer google google-analytics laravel laravel-package packagist spatie
Last synced: 23 days ago
JSON representation
An package to easily setup Google gtag in Laravel apps
- Host: GitHub
- URL: https://github.com/vitorbizarra/laravel-gtag
- Owner: vitorbizarra
- License: mit
- Created: 2024-05-07T00:48:04.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-08T02:57:00.000Z (4 months ago)
- Last Synced: 2024-10-02T05:23:25.611Z (about 1 month ago)
- Topics: analytics, composer, google, google-analytics, laravel, laravel-package, packagist, spatie
- Language: PHP
- Homepage: https://packagist.org/packages/vitorbizarra/laravel-gtag
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# This is my package laravel-gtag
[![Latest Version on Packagist](https://img.shields.io/packagist/v/vitorbizarra/laravel-gtag.svg?style=flat-square)](https://packagist.org/packages/vitorbizarra/laravel-gtag)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/vitorbizarra/laravel-gtag/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/vitorbizarra/laravel-gtag/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/vitorbizarra/laravel-gtag.svg?style=flat-square)](https://packagist.org/packages/vitorbizarra/laravel-gtag)An package to easily setup Google GTag in Laravel apps
## Installation
You can install the package via composer:
```bash
composer require vitorbizarra/laravel-gtag
```You can publish the config file with:
```bash
php artisan vendor:publish --tag="laravel-gtag-config"
```This is the contents of the published config file:
```php
return [
/*
* The Google Analytics id, should be a code that looks something like "G-xxxx".
*/
'id' => env('GTAG_ID', ''),/*
* Enable or disable script rendering. Useful for local development.
*/
'enabled' => env('GTAG_ENABLED', true),/*
* Configures the Google Analytics script domain.
*/
'domain' => env('GTAG_DOMAIN', 'www.googletagmanager.com'),
];
```Optionally, you can publish the views using
```bash
php artisan vendor:publish --tag="laravel-gtag-views"
```## Usage
```html
{{-- layout.blade.php --}}@include('gtag::script')
{{-- ... --}}```
## Testing
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Vitor Bizarra](https://github.com/vitorbizarra)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.