如何使用其.NET API的v3检索Google Analytics(分析)报告数据? [英] How do I retrieve Google Analytics report data using v3 of their .NET api?
问题描述
我一直在尝试使用其提供的.NET api来检索Google Analytics(分析)报告,并一直在认真思考如何使用最新版本v3来实际检索任何内容,该版本可在此处找到:
I've been trying to retrieve Google analytics reports using their provided .NET api and have really been scratching my head over how I actually retrieve anything using the newest version, v3, which is available here: http://code.google.com/apis/analytics/docs/gdata/v3/gdataLibraries.html
For example, I'd like to retrieve a report query like this one: https://www.google.com/analytics/feeds/data?dimensions=ga:browser&end-date=2012-01-25&ids=ga:ACCOUNTID&metrics=ga:visits&start-date=2011-12-25
使用能够使用GData的版本2,我能够很好地返回报告,但希望在版本2被弃用的情况下获得版本3的使用权,但是在看到有意义的文档似乎已经过时或不可行时遇到了很多麻烦-existant,但我找不到任何示例.
I'm able to return reports just fine using version 2 which uses GData, but was hoping to get version 3 going in case version 2 was deprecated, but having a lot of trouble seeing as meaningful documentation seems to be outdated or non-existant and I haven't been able to find any examples.
推荐答案
我们刚刚更新了分析服务,以使用v3.0版的API,因为v2.3版现已弃用,而Google https://developers.google.com/analytics/resources/articles/gdata-migration -指南可能会有所帮助.
We've just updated our analytics service to use v3.0 of the API as v2.3 is now deprecated, there is a migration guide on google https://developers.google.com/analytics/resources/articles/gdata-migration-guide which might help.
我尝试使用google dotnet API http://code.google. com/p/google-api-dotnet-client/支持v3,但由于缺少文档和示例而放弃了.我们正在通过net.httpwebrequest调用api,这比尝试弄清楚API中发生的事情要容易得多.
I tried using the google dotnet API http://code.google.com/p/google-api-dotnet-client/ which supports v3 but gave up as there is a lack of documentation and samples. We're calling the api through a net.httpwebrequest which was easier than trying to work out what's going on in the API.
For v3 your call should be to https://www.googleapis.com/analytics/v3/data/ga?dimensions=ga:browser&end-date=2012-01-25&ids=ga:ACCOUNTID&metrics=ga:visits&start-date=2011-12-25
这篇关于如何使用其.NET API的v3检索Google Analytics(分析)报告数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!