Quick link for those looking to get the Google .NET API:
- http://code.google.com/p/google-gdata/source/checkout
svn checkout http://google-gdata.googlecode.com/svn/trunk/ google-gdata-read-only
- Client Libraries, for languages like Java and .NET: http://code.google.com/apis/gdata/docs/client-libraries.html
- Authentication "ClientLogin" sample code: http://code.google.com/apis/gdata/docs/auth/clientlogin.html
- Getting started: http://code.google.com/apis/accounts/docs/GettingStarted.html
- Data API -account feed: http://code.google.com/apis/analytics/docs/gdata/gdataReferenceAccountFeed.html
- An interesting abalytics blog post: http://analytics.blogspot.com/2009/08/api-sometimes-you-just-gotta-explore.html
I've now been attempting this fun for a little while and there seems to be a fair bit of mis-direction around the Google .NET APIs. My (and others, it seems) main concern is that the .NET APIs seem to cater very well for most Google Labs/Apps uses, except for Google Analytics. Issue #1 being how to even get access/login with .NET. I have since discovered the actual Analytics .NET libraries, so the links are here. However, currently, it's important to note that the links above don't directly link to the libraries you really need.
- Browse the SVN code library online: http://code.google.com/p/google-gdata/source/browse/#svn/trunk/clients/cs/lib/Release
- Checkout the code from here: http://code.google.com/p/google-gdata/source/checkout
It's important to note that you will need Subversion ("SVN") installed to do this and the path to use is: http://google-gdata.googlecode.com/svn/trunk/ - Google "GData" project home: http://code.google.com/p/google-gdata/
It is important to note that the "Downloads" tab here will not get you the Google Analytics library - you need the "Source" tab, which will take you to the SVN link above. - Google Code blog from April 2009 about the new Data Export API: http://googledataapis.blogspot.com/2009/04/google-analytics-data-export-api-has.html
- The StackOverflow post which got me there: http://stackoverflow.com/questions/791125/google-analytics-api-and-net
The code I used to get an authentication token from the Google Analytics Service is:
using Google.GData.Analytics;
AnalyticsService analyticsService = new AnalyticsService(ConfigurationManager.AppSettings["ApplicationName"]);
analyticsService.setUserCredentials(ConfigurationManager.AppSettings["Email"], ConfigurationManager.AppSettings["Password"]);
string analyticsAuthToken = analyticsService.QueryClientLoginToken();
return analyticsAuthToken;
No comments:
Post a Comment