dev-master
9999999-devGoogle Analytics for Laravel 4
MIT
The Requires
- php >=5.3.0
- illuminate/support 4.x
- google/apiclient ~1.0.0-beta
by JC Ivancevich
laravel analytics google laravel4
Wallogit.com
2017 © Pedro Peláez
Google Analytics for Laravel 4
Port of Laravel 3 bundle lordcoste/analytics-s2s for Laravel 4, (*1)
Add ivancevich/analytics to composer.json., (*2)
"ivancevich/analytics": "dev-master"
Run composer update to pull down the latest version of Analytics., (*3)
Now open up app/config/app.php and add the service provider to your providers array., (*4)
'providers' => array(
'Ivancevich\Analytics\AnalyticsServiceProvider',
)
Now add the alias., (*5)
'aliases' => array(
'Analytics' => 'Ivancevich\Analytics\AnalyticsFacade',
)
Run php artisan config:publish ivancevich/analytics and modify the config file with your own informations., (*6)
Querying the API for visits and pageviews in the last week., (*7)
More information about this calling the Google Analytics API can be found here https://developers.google.com/apis-explorer/#s/analytics/v3/analytics.data.ga.get A list of all Google Analytics metrics can be found here https://developers.google.com/analytics/devguides/reporting/core/dimsmets, (*8)
$site_id = Analytics::getSiteIdByUrl('http://github.com/'); // return something like 'ga:11111111'
$stats = Analytics::query($siteID, '7daysAgo', 'yesterday', 'ga:visits,ga:pageviews');
Google Analytics for Laravel 4
MIT
laravel analytics google laravel4