The SitePoint PHP blog has a new tutorial posted from Younes Rafie showing you how to use the Google Analytics API from PHP (part one of a series) using the Google PHP API client library to make the connection.
In this series, we’re going to see how we can use the Google Analytics API to interact with our Google Analytics data via PHP. [...] In this article we’re going to build an app that looks like Google Analytics Explorer, but to make it short, we’re going to limit the functionality and discuss how we can extend our demo.
He starts with an overview of the different parts of the Google Analytics APIs including the metadata and real-time reporting systems. In the tutorial he'll be combining several of these to provide all the data needed. After walking you through the creation of a Google developer account, he starts in on the code. With credentials in hand and the library installed via Composer, he shows how to make the connection, check if it's logged in and makes a simple "home" controller that handles the login and OAuth validation process.