analytics maintained by soda-framework
Description
Soda Framework: Analytics
Authors
Last update
2017/07/28 04:38 (0.1.5)
License
Downloads
14
Last update
2017/07/28 04:38
License
Require
- google/apiclient ^2.0
- laravel/framework ~5.3
- php >=5.5.9
- soda-framework/cms >=0.7
Last update
2017/07/28 04:38
License
Require
- google/apiclient ^2.0
- laravel/framework ~5.3
- php >=5.5.9
- soda-framework/cms >=0.7
Last update
2017/07/28 04:38
License
Require
- google/apiclient ^2.0
- laravel/framework ~5.3
- php >=5.5.9
- soda-framework/cms >=0.7
Last update
2017/07/28 04:14
License
Require
- google/apiclient ^2.0
- laravel/framework ~5.3
- php >=5.5.9
- soda-framework/cms >=0.7
Last update
2017/07/27 03:35
License
Require
- google/apiclient ^2.0
- laravel/framework ~5.3
- php >=5.5.9
- soda-framework/cms >=0.7
Last update
2017/07/27 03:24
License
Require
- google/apiclient ^2.0
- laravel/framework ~5.3
- php >=5.5.9
- soda-framework/cms >=0.7
Last update
2017/07/26 04:10
License
Require
- google/apiclient ^2.0
- laravel/framework ~5.3
- php >=5.5.9
Last update
2017/07/26 03:40
License
Require
- google/apiclient ^2.0
- laravel/framework ~5.3
- php >=5.5.9
comments powered by Disqus
Soda Analytics
A sweet integration with Google Analytics into the Soda Framework
Installation
-
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 requires -
service-account-name
- The name of the Service Account created for Using OAuth 2.0 for Server to Server Applications -
scheduler
- available cron job intervals for the Analytics scheduler
- Add the following Laravel Blade code to your
<head>
to initialize Google Analytics:
@include('soda-analytics::analytics')
Configuration
- Log into the CMS
- Go to Analytics > Configure
- Complete all the steps, in order, to enable and create the relevant apis and access keys.
- You're ready. Start using Analytics > Audience, Events, Schedules.
Usage
Sending Events
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.
Analyzing Events
- Log into the CMS
- Go to Analytics > Events
Analyzing Audience
- Log into the CMS
- Go to Analytics > Audience
Creating Schedules
- Log into the CMS
- Go to Analytics > Schedules
- Choose your desired schedule frequency (the same frequency is used for all schedules)
- Enter the displayed
cron
command onto your server (using thecrontab -e
command) - Create a new schedule
- Choose the type. Event will send event data, Audience, audience data, Events and Audience will send both.
- Enter at least one email to send the report to.
- Click save.
- You can test your schedule by clicking
Run Schedule