2017 © Pedro Peláez
 

library gapi

GAPI is an updated version of Google Analytics PHP Interface

image

jakubpas/gapi

GAPI is an updated version of Google Analytics PHP Interface

  • Wednesday, July 29, 2015
  • by jakubpas
  • Repository
  • 1 Watchers
  • 1 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Synopsis

GAPI is an update version of Google Analytics PHP Interface. The Classes files are separated and the code formatting updated. There composer-based auto-loading mechanism was introduced. The package utilizes deprecated since 2013 authorisation mechanism (login and password). However it is still supported by google., (*1)

Code Example

Get views of given page since beginning to the current date, (*2)

<?php
use JakubPas\Gapi;

$url = 'http://Url.of.page.under.analysis.net';
$ga = new Gapi('eamail@domain.com', 'password');
$filter = 'pagePath == ' . $url;
$startDate = date("Y-m-d", 0);
$endDate = date("Y-m-d");

try {
    $ga->requestReportData(
        943763,
        array('pagePath'),
        array('pageviews'),
        null,
        $filter,
        $startDate,
        $endDate,
        1,
        2000
    );
    $pageViews = $ga->getMetrics()['pageviews'];
} catch (Exception $e) {
    $pageViews = 0;
}

echo $pageViews;

Motivation

The idea of this package is to add composer auto-loader functionality to GAPI code and make it PHP>5.4 compatible. There also some minor bug fixes since the original version., (*3)

Installation

composer require jakubpas/gapi, (*4)

API Reference

The API Reference are yet to be added., (*5)

Tests

The test are yet to be added., (*6)

Contributors

Jakub Pas 2015 Stig Manning 2009, (*7)

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version., (*8)

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details., (*9)

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/., (*10)

The Versions

29/07 2015

dev-master

9999999-dev http://jakubpas.net

GAPI is an updated version of Google Analytics PHP Interface

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

by Jakub Pas

google analytics gapi

29/07 2015

1.0.0

1.0.0.0 http://jakubpas.net

GAPI is an updated version of Google Analytics PHP Interface

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

by Jakub Pas

google analytics gapi