2017 © Pedro Peláez
 

yii2-extension yii2-ga

yii2 google analytics component

image

atlasmobile/yii2-ga

yii2 google analytics component

  • Thursday, March 10, 2016
  • by edwardstock
  • Repository
  • 4 Watchers
  • 2 Stars
  • 113 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 3 % Grown

The README.md

yii2-ga

Google analytics component for Yii2, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist atlasmobile/yii2-ga "*"

or add, (*4)

"atlasmobile/yii2-ga": "*"

to the require section of your composer.json file., (*5)

Application params

To use this extension, add the following code in your application params:, (*6)

return [
    ...
    'googleAnalytics' => [
        'developerKey'       => '', // Public key
        'clientId'           => 'xxx.apps.googleusercontent.com', // Client ID
        'analyticsId'        => 'ga:xxxxxxxxx', //(It is the number at the end of the URL starting with p: https://www.google.com/analytics/web/#home/a33443w112345pXXXXXXXX/)
        'serviceAccountName' => 'xxx@xxx.gserviceaccount.com', // Email address
        'privateKeyPath'     => '', //path to private key in p12 format
    ],
];

Add the serviceAccountName (xxx@dxxx.gserviceaccount.com) as a new user to your Analyics property., (*7)

Usage


use atlasmobile\analytics\Analytics; class Test { public function example() { $analytics = new Analytics(); $analytics->startDate = ''; $analytics->endDate = ''; $sessionsData = $analytics->getSessions(); $visitorsData = $analytics->getUsers(); $pageViewsData = $analytics->getPageViews(); $avgSessionsDurationData = $analytics->getAvgSessionDuration(); $countriesData = $analytics->getCountries(); } }

Parameters 'startDate' and 'endDate' are set by default for yesterday, (*8)

Analytics Core Reporting API
Google API Php Client, (*9)

The Versions

10/03 2016

dev-master

9999999-dev

yii2 google analytics component

  Sources   Download

BSD-4-Clause

The Requires

 

by Emin Ganbarov

extension yii2 google-analytics ga

10/03 2016

1.0.4

1.0.4.0

yii2 google analytics component

  Sources   Download

BSD-4-Clause

The Requires

 

by Emin Ganbarov

extension yii2 google-analytics ga

10/03 2016

1.0.2

1.0.2.0

yii2 google analytics component

  Sources   Download

BSD-4-Clause

The Requires

 

by Emin Ganbarov

extension yii2 google-analytics ga