All Projects → irazasyed → Laravel Gamp

irazasyed / Laravel Gamp

Licence: mit
📊 Laravel Google Analytics Measurement Protocol Package

Projects that are alternatives of or similar to Laravel Gamp

Orm
A drop-in Doctrine ORM 2 implementation for Laravel 5+ and Lumen
Stars: ✭ 712 (+162.73%)
Mutual labels:  hacktoberfest, laravel, laravel-package, laravel-5-package
Telegram
✈️ Telegram Notifications Channel for Laravel
Stars: ✭ 450 (+66.05%)
Mutual labels:  hacktoberfest, laravel, laravel-package, laravel-5-package
Bagisto
An easy to use, free and open source laravel eCommerce platform to build your online shop in no time.
Stars: ✭ 4,140 (+1427.68%)
Mutual labels:  hacktoberfest, laravel, laravel-package
Laravel Schedulable
Schedule and unschedule eloquent models elegantly without cron jobs
Stars: ✭ 78 (-71.22%)
Mutual labels:  hacktoberfest, laravel, laravel-package
Lara Lens
Laravel package for display diagnostic (config, database, http connections...)
Stars: ✭ 96 (-64.58%)
Mutual labels:  hacktoberfest, laravel, laravel-package
Laravel Starter
A CMS like modular starter application project built with Laravel 8.x.
Stars: ✭ 299 (+10.33%)
Mutual labels:  hacktoberfest, laravel, laravel-package
Validator Docs
Validação de CPF, CNPJ, CNH, NIS, Título Eleitoral e Cartão Nacional de Saúde com Laravel.
Stars: ✭ 334 (+23.25%)
Mutual labels:  hacktoberfest, laravel, laravel-package
Laravel Weather
🌤️ A wrapper around Open Weather Map API (Current weather)
Stars: ✭ 36 (-86.72%)
Mutual labels:  hacktoberfest, laravel, laravel-package
Laravel Mail Editor
MailEclipse ⚡ Laravel Mailable Editor!
Stars: ✭ 1,714 (+532.47%)
Mutual labels:  hacktoberfest, laravel, laravel-package
Simple Qrcode
An easy-to-use PHP QrCode generator with first-party support for Laravel.
Stars: ✭ 1,923 (+609.59%)
Mutual labels:  hacktoberfest, laravel, laravel-package
Laravelresources
Speed Up package development for Laravel Apps with API's
Stars: ✭ 152 (-43.91%)
Mutual labels:  hacktoberfest, laravel, laravel-package
Laravel Gitscrum
GitScrum is a Project Management Tool, developed to help entrepreneurs, freelancers, managers, and teams Skyrocket their Productivity with the Agile methodology and Gamification.
Stars: ✭ 2,686 (+891.14%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Auth Tests
Always-current tests for Laravel's authentication system. Curated by the community.
Stars: ✭ 230 (-15.13%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Sneaker
An easy way to send emails whenever an exception occurs on server.
Stars: ✭ 223 (-17.71%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Wagonwheel
Offer an online version of your Laravel emails to users.
Stars: ✭ 224 (-17.34%)
Mutual labels:  hacktoberfest, laravel, laravel-package
Hooks
Hooks is a extension system for your Laravel application.
Stars: ✭ 202 (-25.46%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Voyager Hooks
Hooks system integrated into Voyager.
Stars: ✭ 200 (-26.2%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Voyager Frontend
The Missing Front-end for The Missing Laravel Admin 🔥
Stars: ✭ 200 (-26.2%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Facebook
📨 Facebook Notifications Channel for Laravel
Stars: ✭ 120 (-55.72%)
Mutual labels:  hacktoberfest, laravel, laravel-5-package
Laravel Surveillance
Put malicious users, IP addresses and anonymous browser fingerprints under surveillance, log the URLs they visit and block malicious ones from accessing the Laravel app.
Stars: ✭ 198 (-26.94%)
Mutual labels:  hacktoberfest, laravel, laravel-package

Laravel-GAMP Package

Join PHP Chat Chat on Telegram Laravel & Lumen Package Latest Version on Packagist Software License SensioLabsInsight Total Downloads

Laravel GAMP: Google Analytics Measurement Protocol Package for Laravel & Lumen.

Send data to Google Analytics from Laravel/Lumen. Supports all GA Measurement Protocol API methods.

Laravel GAMP

Quick start

Install

Step 1: Install Through Composer

$ composer require irazasyed/laravel-gamp

(Lumen) Add the Service Provider

Open bootstrap/app.php and register the service provider by adding:

$app->register(Irazasyed\LaravelGAMP\LaravelGAMPServiceProvider::class);

Step 2: Publish Config

Open your terminal window and fire the following command to publish config file to your config directory:

$ php artisan vendor:publish --provider="Irazasyed\LaravelGAMP\LaravelGAMPServiceProvider"

Usage

Open config file config/gamp.php and set the tracking_id with your Google Analytics tracking / web property ID. Refer the config file for other default configuration settings.

This Package adds Laravel Support to GA Measurement Protocol PHP Library by THE ICONIC. It's simply a wrapper around the library with default config for easier usage with Laravel. So all the methods listed here are available and will work seamlessly.

Example Usage

Send a Page view hit:

use Irazasyed\LaravelGAMP\Facades\GAMP;

$gamp = GAMP::setClientId( '123456' );
$gamp->setDocumentPath( '/page' );
$gamp->sendPageview();

Send an Event:

use Irazasyed\LaravelGAMP\Facades\GAMP;

$gamp = GAMP::setClientId( '123456' );
$gamp->setEventCategory('Blog Post')
->setEventAction('Create')
->setEventLabel('Using GAMP In Laravel')
->sendEvent();

Config Overview

Open the config file for detailed comments for each option.

Set your Google Analytics Tracking / Web Property ID in tracking_id key [REQUIRED]

'tracking_id' => 'UA-XXXX-Y',

All other configuration options are optional, use as per your requirements.

To send data over SSL, set is_ssl to true.

'is_ssl' => true,

To disable library in Staging/Dev env (Prevents the library from sending any hits to GA), set is_disabled to true.

'is_disabled' => true,

To Anonymize IP, set anonymize_ip to true.

'anonymize_ip' => true,

To Make Async Requests, set async_requests to true.

'async_requests'  => true,

...

Refer the library's documentation for other remaining methods and examples, they all work.

Note: You don't have to use the protocol version, tracking id, anonymize ip and async request (non-blocking) methods from the original library as they're automatically set in Service Provider when the package is initialized based on the config file. As long as you update the config file with correct settings, it should work just fine.

Additional information

Any issues, please report here

Credits

License

The MIT License (MIT). Please see License File for more information.

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].