I found a method using . NET library for the Google Data API . I found this link thanks to this guy . Here is a working code listing all Google Analytics accounts, given that GOOGLE_APPS_DOMAIN_SECRET is the key generated using this method , the DOMAIN domain is the Google Apps domain, and the username is the prefix (for example: "firstname.lastname") of the letter from The Google Apps user to whom we want to impersonate (for example, an administrator to have access to everything):
var requestFactory = new GOAuthRequestFactory("an", "Any app name"); requestFactory.ConsumerKey = DOMAIN; requestFactory.ConsumerSecret = GOOGLE_APPS_DOMAIN_SECRET; var service = new AnalyticsService("Any app name"); service.RequestFactory = requestFactory; var query = new AccountQuery(); query.OAuthRequestorId = username + "@" + DOMAIN; var serviceQuery = service.Query(query); foreach (AccountEntry Entry in serviceQuery.Entries) { WriteLine(Entry.Title.Text); }
The only problem is that I have to impersonate the user and cannot just access everything.
EDIT: method deprecated
billy source share