문제

Google Analytics Data API를 사용하여 국가별로 데이터를 필터링하려고합니다. .NET 라이브러리를 사용하고 있습니다 http://google-gdata.googlecode.com/svn/trunk/ 국가별로 필터링하려고하지 않는 한 아름답게 작동합니다.

이것은 잘 작동합니다 :

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를 시도했지만 도움이되지 않았습니다.

어떤 아이디어?

도움이 되었습니까?

해결책

마침내 응답을 발견 하고이 메시지를 보았습니다.

"Illegal combination of dimensions and metrics"

분명히, 나는 사용할 수없는 데이터를 얻으려고 노력하고 있습니다. 이것은 볼 때 의미가 있습니다 쿼리 검증 차트 문서에서.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top