Google Analytics API PHP Class
Cris Hope has created a PHP class for accessing the Google Analytics API with CURL and using DOMDocument to parse the XML. The resulting class and example script can be downloaded here and there are a number of posts on this website showing how to use it.
Code Reuse
Feel free to use the class as you wish but if re-posting it on other websites or using it in your own projects or for your customers, please retain the notice in the analytics class file attributing the original work to Cris.
GA API Introductory Posts
The following posts cover a couple of things about the Google Analytics API:
Code examples
The following code examples have been posted for using the Analytics class:
- Basic data example getting the most popular pages
- Get the profile id from the accounts list
- Get data without a dimension
- Looping through the data
- Using filters
- Paging through result data
- Calculating a page's bounce rate