Google Analytics API 客户端库之间有什么区别? (google-api-dotnet-client 与 google-gdata)
适用于 .NET 的 Google API 客户端库之间有什么区别( google-api-dotnet-client) 和 Google Data API 的 .NET 库 ( google-gdata) 因为它们属于 Google Analytics API?
What is the difference between the Google APIs Client Library for .NET (google-api-dotnet-client) and .NET library for the Google Data API (google-gdata) as they pertain to the Google Analytics API?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
根据我(有限的)经验:
GData 具有更好的集成 OAuth2 支持,更易于使用。
GoogleApiDotnetClient 服务返回特定子类型,而 GData 返回基本类型。例如,GoogleApiDotnetClient 日历事件请求返回
IEnumerable
类型,而 GData 返回IEnumerable
,其中每个实例实际上是一个EventEntry
code>.GoogleApiDotnetClient 实例更简单,例如
Event.Summary
是一个字符串字段,而 GData 的 Summary 是一个AtomTextConstruct
,它具有Text
属性.GoogleApiDotnetClient 不支持某些 API,尤其是电子表格。
日期在 GoogleApiDotnetClient 中往往是字符串,但在 GData 中是正确的
DateTime
值。遗憾的是,两者都没有任何 XML 注释。
到目前为止我更喜欢GoogleApiDotnetClient,但坦率地说,两者都有很大的改进空间。
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 anIEnumerable<AtomEntry>
where each instance is actually anEventEntry
.GoogleApiDotnetClient instances are simpler, for example an
Event.Summary
is a string field whereas GData's Summary is anAtomTextConstruct
which has aText
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.
它们都链接到谷歌“Core Reporting API”页面。
http://code.google.com/apis/analytics/docs /gdata/v3/gdataLibraries.html
一个在 v3.0 下链接,一个在 v2.4 下链接。
v3.0 的 .net 库似乎仍处于测试阶段。
这里有 v3.0 和 v2.4 之间的比较:http:// /code.google.com/apis/analytics/docs/gdata/home.html
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
Google 为那些喜欢/需要在 .Net 中编写应用程序的人提供了 .Net 包装器:
PS:
Google 数据 (GData) != Google Analytics API:
http://code.google.com/apis /分析/
Google provides a .Net wrapper for those who prefer/need to code their application in .Net:
PS:
Google Data (GData) != Google Analytics API:
http://code.google.com/apis/analytics/
(2020 年 9 月) 几乎所有其他答案现在都已过时(包括任何
code.google.com
链接)。 GData API 是上一代 Google API,旧的 GData Docs API 文档正在更新更难找到。虽然并非所有 GData API 均已弃用,但所有较新 Google API不使用Google 数据协议。具体来说,对于 Analytics(分析),Google 不仅发布了新的 API,还发布了整个家族 API,其中没有一个是 GData。为了使用上面链接的新 API,您需要获取Google API 客户端库对于 .NET/C#,然后选择您要使用的 API。总体而言,开发人员获得了更强大的功能和更强大的功能。灵活的经验和比旧版 API 版本的功能。最后,每个 API 都应该有自己的代码示例来帮助您入门。如果您仍然需要旧 API(报告 API v2 和 v3)的文档,可以在 此页面。
(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.