soda-framework/analytics is a Laravel package for soda framework: analytics.
It currently has 0 GitHub stars and 82 downloads on Packagist (latest version 0.1.5).
Install it with composer require soda-framework/analytics.
Discover more Laravel packages by soda-framework
or browse all Laravel packages to compare alternatives.
Last updated
A sweet integration with Google Analytics into the Soda Framework
Firstly follow the instructions to install Soda CMS at: https://github.com/soda-framework/cms
Install Soda Analytics with composer
#!bash
composer require soda-framework/analytics
Add Soda\Analytics\Providers\AnalyticsServiceProvider::class
Run php artisan vendor:publish
Run php artisan migrate
Modify config/soda/analytics.php according to your needs:
apis - Google Console API's Soda Analytics requiresservice-account-name - The name of the Service Account created for Using OAuth 2.0 for Server to Server Applicationsscheduler - available cron job intervals for the Analytics scheduler<head> to initialize Google Analytics:@include('soda-analytics::analytics')
Send events as normal with Google Analytics:
ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);
Or use our helper function:
send_event([eventCategory], [eventAction], [eventLabel] (optional), [eventValue] (optional));
For best results, try to use all the parameters.
cron command onto your server (using the crontab -e command)Run Schedule