尝试从C#中的Google Analytics API测试此帐户供稿。AccountFeed返回null,GA API
无论如何,这里是代码示例,由于某些原因,accountFeed保留为空,即使我提供帐户信息。不知道这是否是版本问题。
public AccountFeedExample()
{
// Configure GA API.
AnalyticsService asv = new AnalyticsService("gaExportAPI_acctSample_v2.0");
// Client Login Authorization.
asv.setUserCredentials(CLIENT_USERNAME, CLIENT_PASS);
// GA Account Feed query uri.
AccountQuery query = new AccountQuery("https://www.googleapis.com/analytics/v2.4/management/accounts");
//Tried to manually insert the date info, still shows the accountfeed as null.
query.StartDate = new DateTime(2014, 1, 1);
query.EndDate = new DateTime(2014, 1, 14);
// Send our request to the Analytics API and wait for the results to
// come back.
accountFeed = asv.Query(query);
}
试图将它在这个格式重新写: http://www.googleapis.com/analytics/v2.4/management/accounts/1234/webproperties/UA-1234-2/profiles
从以下链接: https://developers.google.com/analytics/devguides/config/mgmt/v2/mgmtFeedReference#accountFeed
似乎不工作,不知道我错过了什么。
只是通过您的教程,它正是我所需要的,我也得到了nuget安装。谢谢,给你检查和啧啧的+1。 –