We have previously talked about Google Analytics PHP API, in that time there was no official API available yet. Today Google Analytics API is officially available to developers, so you can get your code working with a real API instead of hacks that might broke anytime if Google update their service… etc.
Doug Tan, Ask about PHP, have written Google Analytics PHP Class using the new API and a good tutorial on how to use it. Pretty simple and very easy to use, you will get Analytics data right in your applications in minutes. Below a sample code :