我试着按照下面的例子实现这个接口:Use Google Analytics API to show information in C#
我遵循了所有的说明,事实上,我成功地通过了身份验证。当我获得帐户列表时,我实际上看到了正确的帐户/配置文件,并且我看到我拥有所有权限。
var path = HostingEnvironment.MapPath("~/ServiceAccountProject-354a114cc3c1.p12");
var email = "myemail@developer.gserviceaccount.com";
GoogleConnector ga = new GoogleConnector(path,email );
var accounts = ga.Service.Management.Accounts.List().Execute();但是,当我执行下一行以获取我对其具有完全权限的确切帐户的分析数据时,我收到错误消息"Google.Apis.Requests.RequestError User没有足够的权限访问此配置文件。403错误[MessageUser没有足够的权限访问此配置文件。Location - ReasoninsufficientPermissions Location全局]“
var path = HostingEnvironment.MapPath("~/ServiceAccountProject-354a114cc3c1.p12");
var email = "myemail@developer.gserviceaccount.com";
GoogleConnector ga = new GoogleConnector(path,email );
var accounts = ga.Service.Management.Accounts.List().Execute();
var nuberOfPageViews = ga.GetAnalyticsData("ga:" + accounts.Items[0].Id, new string[] { "ga:pageviews" },
DateTime.Now.AddDays(-1), DateTime.Now).Rows[0][0];请帮帮我!
发布于 2015-01-30 01:19:24
当您需要使用视图(配置文件) Id时,您正在使用accounts.Items.Id。
尝试使用account explorer,您可以看到帐户Id、属性Id和视图(配置文件) Id之间的区别。
https://stackoverflow.com/questions/28198886
复制相似问题