【发布时间】:2012-10-02 23:47:59
【问题描述】:
我正在使用 Google Analytics API 从我的 Analytics 帐户中获取 web property information。
当我登录分析时,我只有一个网站,但通过 api 我得到了几个(旧的和已删除的网站)
我的代码是这样的:
var provider = new WebServerClient(GoogleAuthenticationServer.Description)
{
ClientIdentifier = _appId,
ClientSecret = _appSecret
};
var auth = new OAuth2Authenticator<WebServerClient>(provider, x => new AuthorizationState { AccessToken = token });
var analyticsService = new AnalyticsService(auth);
var accounts = analyticsService.Management.Accounts.List().Fetch();
foreach (var account in accounts.Items)
{
var webProperties = analyticsService.Management.Webproperties.List(account.Id).Fetch();
// todo: determine if web property is still in use?
}
如何从代码中判断哪些仍处于活动状态?
【问题讨论】:
标签: c# google-api google-analytics-api