News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lorna Mitchell's Blog:
Google Analytics Accounts API
November 23, 2010 @ 10:56:35

In this new post to her blog Lorna Mitchell looks at some of the work she's done to extract information out of the Google Analytics accounts API via an OAuth interface and parsed via SimpleXML.

I'm using pecl_oauth to authenticate users against their google accounts (see my post about using OAuth from PHP), but even after I have a valid google user, working out which analytics accounts they have access to and how to refer to them is a puzzle in itself, so I thought I'd share what I learned.

In her example she shows how to fetch the permissions for a user (which analytics they can access) via a call to the "/feeds/datasources/ga/accounts" URL. This returns some XML easily parsed by SimpleXML to grab the accounts' names and IDs. This is used to fetch the profiles and gather the "magic tableId" for use with the Export API to pull the actual data.

0 comments voice your opinion now!
google analytics account api oauth tutorial simplexml


blog comments powered by Disqus

Similar Posts

DevShed: Building Your Own Desktop Notepad Application Using PHP-GTK

Master Zend Framework: How to view an Instagram Photo Stream in Zend Framework 2

Jani Hartikainen's Blog: Zend_Acl part 2: different roles and resources, more on access

PHPit.net: Image manipulation with PHP & the GD library (Part 1)

Zend Developer Zone: AJAX Chat Tutorial Part 2


Community Events

Don't see your event here?
Let us know!


version php7 unittest community library security api language series release podcast voicesoftheelephpant list interview laravel5 laravel framework extension introduction opinion

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework