Google’s PHP client library for their GData API hasn’t received as much love as their client libraries for other languages. Despite the lack of high level service classes for Google Analytics’ Core Reporting API it is possible to work with it using google-api-php-client.
The below is a quick and dirty self contained example based on a Google+ example to get a report. Before you get started go to the API Console and enable access to the Analytics API and generate a client id, client secret, and to register your redirect uri.





