0
我使用Google Analytics API從我的Google Analytics帳戶獲取web property information。如何判斷使用Google AnalyticsService刪除網站媒體資源?
當我登錄到analaytics雖然,我只有一個網站,但通過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?
}
從代碼如何我可以告訴哪些人仍然活躍?