0
我正尝试使用Google Analytics数据API获取按国家/地区过滤的数据。我使用.NET库http://google-gdata.googlecode.com/svn/trunk/,只要我不尝试按国家进行过滤,它的效果非常好。使用谷歌分析数据API按国家过滤
这工作得很好:
const string dataFeedUrl = "https://www.google.com/analytics/feeds/data";
var query = new DataQuery(dataFeedUrl);
query.Ids = this.ProfileID;
query.GAStartDate = this.FromDate;
query.GAEndDate = this.ToDate;
query.Metrics = "ga:newVisits,ga:visitors";
DataFeed dataFeed = this.AnalyticsService.Query(query);
但是,如果我查询调用之前补充一点:
query.Filters = string.Format("ga:country=={0}", this.Country);
query.Dimensions = "ga:country";
...我得到这个异常:
System.Exception {Google.GData.Client.GDataRequestException}
"Execution of request failed: https://www.google.com/analytics/feeds/data?dimensions=ga:country&end-date=2009-06-17&filters=ga:country==Denmark&ids=ga:xxx&metrics=ga:newVisits,ga:visitors&start-date=2009-05-18"
我已经尝试手动转义==到%3D%3D,但没有帮助。
任何想法?
当您将==编码为%3D%3D时出现什么错误? (对我来说,这是这里唯一的问题) – 2009-06-17 17:44:32