简体   繁体   中英

What's the difference between Google Analytics API client libraries? (google-api-dotnet-client vs. google-gdata)

用于 .NETGoogle API 客户端库(google-api-dotnet-client) 和用于 Google Data API (google-gdata) 的.NET 库Google Analytics API 有什么区别?

In my (limited) experience:

  • GData has a better integrated OAuth2 support, which is easier to use.

  • GoogleApiDotnetClient services return specific subtypes while GData returns base types. For example, a GoogleApiDotnetClient calendar events request returns something typed IEnumerable<Event> , while GData returns an IEnumerable<AtomEntry> where each instance is actually an EventEntry .

  • GoogleApiDotnetClient instances are simpler, for example an Event.Summary is a string field whereas GData's Summary is an AtomTextConstruct which has a Text property.

  • GoogleApiDotnetClient does not support some APIs, notably Spreadsheets.

  • The dates tend to be strings in GoogleApiDotnetClient but proper DateTime values in GData.

  • Neither has any XML comments whatsoever, sadly.

So far I have a preference for GoogleApiDotnetClient, but frankly, both of them have lots of space for improvement.

They are both linked to from google "Core Reporting API" pages. http://code.google.com/apis/analytics/docs/gdata/v3/gdataLibraries.html

One is linked under v3.0, and one from v2.4.

The .net library for v3.0 still appears to be in beta.

There is a comparison between v3.0 and v2.4 here: http://code.google.com/apis/analytics/docs/gdata/home.html

(Sep 2020) Pretty much all other answers are now out-of-date (including any code.google.com links). GData APIs are the previous generation of Google APIs, and old GData Docs API documentation is getting harder to find. While not all GData APIs have been deprecated, all newer Google APIs do not use the Google Data protocol . For Analytics specifically, Google didn't just release a new API, but an entire family of APIs , none of which are GData.

In order to use the new APIs linked to above, you need to get the Google APIs Client Library for .NET/C# , then choose which API(s) you want to use. Overall, developers get a more powerful & flexible experience & functionality than older API releases. Finally, each API should have their own code samples to help get you kickstarted. If you still need the docs for the old APIs (Reporting API v2 & v3), they're available at the bottom of this page .

Google provides a .Net wrapper for those who prefer/need to code their application in .Net:

http://code.google.com/p/google-gdata/

The GData .NET Client Library provides a library and source code that make it easy to access data through Google Data APIs.

PS:

Google Data (GData) != Google Analytics API:

http://code.google.com/apis/analytics/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM