使用 C# 访问 Google Analytics

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15734/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-01 08:51:00  来源:igfitidea点击:

Google Analytics Access with C#

提问by Detlef D. Doerscheln

I know that there is no official API for Google Analytics but is there a way to access Google Analytics Reports with C#?

我知道 Google Analytics 没有官方 API,但是有没有办法使用 C# 访问 Google Analytics 报告?

采纳答案by Michael Johnson

Update: Google launched a Google Analytics API today. Google Analytics Blog - API Launched

更新:谷歌今天推出了谷歌分析 API。 Google Analytics 博客 - API 发布

回答by xanadont

This guyhas had some success with at least some light Analytics integration. Now I realize this isn't exactly what you're looking for, but he does mention a book and perhaps you can get in touch with him.

这家伙至少在一些轻量级分析集成方面取得了一些成功。现在我意识到这不是你要找的东西,但他确实提到了一本书,也许你可以与他取得联系。

回答by xanadont

I emailed them asking this same question a while back and here's the response I got:

不久前我给他们发了电子邮件,问了同样的问题,这是我得到的答复:

Hello,

你好,

Thank you for your email. I apologize for the delay in replying to your email. Google Analytics does not currently provide an API to access the reporting data. However, we do offer export functionality for single reports in the following formats:

谢谢您的来信。对于延迟回复您的电子邮件,我深表歉意。Google Analytics 目前不提供 API 来访问报告数据。但是,我们确实为以下格式的单个报告提供导出功能:

  • PDF
  • Tab separated value (TSV)
  • XML
  • Excel (CSV)
  • PDF
  • 制表符分隔值 (TSV)
  • XML
  • 电子表格 (CSV)

This feature allows you to easily import report data into your favorite spreadsheet application or to process the data otherwise.

此功能允许您轻松地将报告数据导入您喜欢的电子表格应用程序或以其他方式处理数据。

Additionally, we're unable to provide support for custom implementations of Google Analytics. For this level of support, you can contact one of our highly qualified Google Analytics Authorized Consultants for assistance with advanced needs. These partners deliver a number of professional services such as installation support, training, and advanced filter and e-commerce configurations.

此外,我们无法为 Google Analytics 的自定义实现提供支持。对于这种级别的支持,您可以联系我们的一位高素质的 Google Analytics 授权顾问,以获取高级需求方面的帮助。这些合作伙伴提供许多专业服务,例如安装支持、培训以及高级过滤器和电子商务配置。

For a complete list of our worldwide partners and a more detailed description of the services they offer, please go to http://www.google.com/analytics/support_partner_provided.html

有关我们全球合作伙伴的完整列表以及他们提供的服务的更详细说明,请访问http://www.google.com/analytics/support_partner_provided.html

For additional questions, please visit the Analytics Help Center at http://www.google.com/support/googleanalytics/?utm_id=tf. You can also find helpful tips and information by visiting the Google Analytics Help Forum at http://groups.google.com/group/analytics-help?utm_id=tr.

如有其他问题,请访问位于http://www.google.com/support/googleanalytics/?utm_id=tf的 Google Analytics(分析)帮助中心。您还可以通过访问位于http://groups.google.com/group/analytics-help?utm_id=tr的 Google Analytics 帮助论坛找到有用的提示和信息。

Sincerely,

真挚地,

[snip]

[剪辑]

Analytics Support

分析支持



For the latest updates as well as some helpful tips on Google Analytics, check out the Google Analytics blog at http://analytics.blogspot.com

有关 Google Analytics 的最新更新以及一些有用的提示,请查看位于http://analytics.blogspot.com的 Google Analytics 博客



回答by Michael Johnson

I wrote a small project that lets you generate pretty much any Analytics report. It's listed on Google's Analytics API page - http://code.google.com/apis/analytics/docs/gdata/gdataArticlesCode.html

我编写了一个小项目,可以让您生成几乎所有的 Analytics 报告。它列在 Google 的 Analytics API 页面上 - http://code.google.com/apis/analytics/docs/gdata/gdataArticlesCode.html

You can read about it here and get the source code - http://www.reimers.dk/blogs/jacob_reimers_weblog/archive/2009/05/09/added-google-analytics-reader-for-net.aspx

您可以在此处阅读并获取源代码 - http://www.reimers.dk/blogs/jacob_reimers_weblog/archive/2009/05/09/added- google- analytics- reader- for- net.aspx

回答by Doug

I have a completed library for called GoogleAnalytics.Net that allows you to fire page views/events/transactions from within .net code.

我有一个名为 GoogleAnalytics.Net 的完整库,它允许您从 .net 代码中触发页面视图/事件/事务。

You can download the library from it's project home page:

您可以从它的项目主页下载该库:

http://www.diaryofaninja.com/projects/details/ga-dot-net

http://www.diaryofaninja.com/projects/details/ga-dot-net

回答by DevT

Google analytics API changed recently(2012) and because of that most of the codings are changed. so below link will be helpful for c# developers

谷歌分析 API 最近发生了变化(2012 年),因此大部分编码都发生了变化。所以下面的链接对 c# 开发人员很有帮助

Google Analytics API in C# -Execution of request failed: https://www.google.com/analytics/feeds/accounts/default

C# 中的 Google Analytics API - 请求执行失败:https://www.google.com/analytics/feeds/accounts/default

回答by Valentin Vasilyev

Yet another analytics API for C# https://github.com/igooana/igooana

另一个 C# 分析 API https://github.com/igooana/igooana

This project is aimed at C# 5 and uses async/awaitand dynamicextensively. I tried to make this API as simple as possible and maximum type-safe.

该项目针对 C# 5async/awaitdynamic广泛使用。我试图使这个 API 尽可能简单和最大类型安全。

回答by DaImTo

Google has created there own client lib Google APIs Client Library for .NETwhich allows for access to most of the Google Apis using dotnet.

Google 在那里创建了自己的客户端库Google APIs Client Library for .NET,它允许使用 dotnet 访问大多数 Google API。

Then can be found on nuget

然后可以在nuget找到