Hi Chris, You are exactly right, and appear to have a perfectly good PHP api class. I guess that is typical for PHP, with everyone trying to reinvent the wheel.
I will be adding the parsing shortly. I wonder though, it appears that your class doesn't give out the metrics for the entire table - like total pageviews, total visits, I guess you could calculate this by summing up the results. I am planning on having all of the metrics data returned as objects (with 'get' functions), kind of like an ORM for the XML. I was inspired by the ORM interfaces like doctrine and prototype and how easy it is to work with this data, including related data. Let me know if you would like svn write for the class, it would be great to have someone who already has loads of experience with the API helping out. Cheers, Stig Chris Hope wrote: > You might want to actually parse the resulting data into something > more useful than returning just XML. Feel free to take the XML parsing > code from my class (and modify to suit) which you can find here: > http://www.electrictoolbox.com/google-analytics-api-and-php/ > > Cheers, > Chris > > > 2009/5/5 Stig Manning <[email protected]>: > >> Hi PHPUG, >> >> Last week Google gave access to the analytics reporting data through a >> new XML API service. This API gives some pretty powerful tools for >> making your own reports and metrics in your applications. E-commerce >> systems can now have conversion metrics right in the product detail >> pages of your e-commerce backend. >> >> I have been frustrated by the lack of PHP examples for the API, and now >> that they finally have some third party examples, they are all >> procedural code. If you are like me and work in symfony, cakePHP, zend >> framework or maybe even your own OO MVC framework this isn't going to do it. >> >> Anyway, <plug> I have created a Google Analytics PHP Interface called >> the GAPI http://www.sdm.co.nz/google-analytics-php5-api/ I have set up a >> google code project for this class and have the file ready for you to >> check out. It is open-source, GNU licensed and I would like other >> awesome php devs to come on board to help with the next step, which is >> coming up with some tools for working with the heavily namespaced XML >> data returned. Let me know if anyone wants svn write access off-board. >> >> Download the class, sign up for Google Analytics if you haven't already, >> and let me know what you think.</plug> >> >> Cheers, >> Stig Manning >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected] -~----------~----~----~----~------~----~------~--~---
