Skip to content


Subversion checkout URL

You can clone with
Download ZIP


notdior edited this page · 10 revisions
Clone this wiki locally

WB_analytics is a PHP library which will help you fetch analytics reports from your Google account. Google announced an API some months ago but nothing happened ever since so we created this class which will be updated if the API will be published.

WB_analytics was build for one of our modules for Webber. You can view more informations here here.

This data source uses web scraping. This means that Google could easily break it by making changes to the infrastructure of Google Analytics.

It is based on Felix's class which does the same think but for CakePHP.


$analytics = new wb_analytics; $analytics->config [ 'user' ] = 'analytics username'; $analytics->config [ 'password' ] = 'analytics password';

$report = array ( 'profile' => 11040536, 'from' => '2009-01-22', 'to' => '2009-02-22', 'report' => 'Dashboard' );

echo $analytics->report ( $report );// output is XML

In the above example we're fetching the dashboard. There are other report types such as Visits, UniqueVisitors, Resolutions, content.TopContent, Keywords, ReferringSources, TrafficSources, Speeds and many others.

Category:Library Category:Library::Analytics Category:Library::Charts

Something went wrong with that request. Please try again.