Download the PHP package jmpatricio/easy-google-analytics without Composer
On this page you can find all versions of the php package jmpatricio/easy-google-analytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package easy-google-analytics
Easy Google Analytics
Laravel Package to connect Google Analytics
Changelog
- 1.0.4 | 2015-08-21
- Added new users metric
- Duplicate code removed
- PHP Docs improved
- Code Style fixed
Instalation
-
Run
composer require jmpatricio/easy-google-analytics
-
Add
Jmpatricio\EasyGoogleAnalytics\EasyGoogleAnalyticsServiceProvider
to your service providers - Instalation Done.
Configuration
This step is the most important. Let's make it simple:
- Open a terminal and run:
php artisan config:publish "jmpatricio/easy-google-analytics"
. -
Now you have
{$projectRoot}/app/config/packages/jmpatricio/easy-google-analytics/config.php
file with: -
Now you have to go to your googe developer account and configure a new project. (If you already have a project, ignore this step)
-
You need to enable the Analytics API to your project. Inside project, go to APIs & auth and then inside APIs. Enable the analytics
-
Inside the project, on developers console, go to Credentials inside APIs & auth, create a new Service Account
-
Choose a p12 key
- Save your p12 key inside
{$projectRoot}/app/storage
.
-
Edit the config file and define the keyfile entry:
'keyfile' => storage_path('Easy-Google-Analytics-da31194a03c6.p12'),
-
Now you have the information about the credentials Click on the email, and the following screen shows up:
-
Add the client id and the email address to the config:
-
Now the only thing missing is the analytics id
- Go to your analytics dashboard, and inside the admin area select the view settings:
- Copy the view id and add to the config:
The config will be the following:
- Now we have to add permissions to the service account inside analytics console:
- Go to the analytics admin console, and add the user with the respective permissions:
- The configuration is complete!
Basic usage
All versions of easy-google-analytics with dependencies
illuminate/support Version 4.2.*
google/apiclient Version 1.1.*
nesbot/carbon Version ~1