Download the PHP package marshmallow/google-analytics without Composer
On this page you can find all versions of the php package marshmallow/google-analytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marshmallow/google-analytics
More information about marshmallow/google-analytics
Files in marshmallow/google-analytics
Package google-analytics
Short Description Sending request to you Google Analytics has never been easier. With support for e-commerce tracking.
License MIT
Homepage https://github.com/Marshmallow-Development/
Informations about the package google-analytics
Laravel Google Analytics Package
Send request to you Google Analytics has never been easier.
Installation
You can install the package via composer:
Usage
Use with an event listener
The easiest way to use this package is to use Events and Listners. For instance. If you want to use the ecommerce tracking your should create an event like OrderCreated
. This event should implement GoogleAnalyticsEvent
. This will require you to implement the withAnalytics
method.
The withAnalytics method
withAnalytics
will provide you with an instance of GoogleAnalytics
where you can add the Google Types
you wish to send to Google Analytics. Below is an example of how this could look.
Register the Listener
Add the GoogleEcommerceTrigger
listner to your EventServiceProvider.php
.
Concatunate types
You can add as many types as you want. To stay with the example above, lets say you want to let Google Analytics now which products where sold with this order.
Google Event Types
Below you find an overview of the different Google Types we currently support and how you can use them.
Event
Event
Ecommerce Tracking
Ecommerce item (Item Hit)
Stand alone example
If you don't want to use this with an event and listner, you can use it stand alone as well.
Changelog
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- All Contributors
License
The MIT License (MIT). Please see License File for more information.