How to send Google analytic report query using ASP.net Google analytic api Version 3(Google.Apis.Analytics.v3.dll)?

笑着哭i 提交于 2019-12-03 21:05:52

After searching around on stackoverflow and google for a few days, here is what I found out. Unlike previous version, you need to create a "GetRequest" object using AnalyticService and fetch the data using that object to get "GaData" result object back. Here is the code:

var request = _analyticsService.Data.Ga.Get(ProfileID, StartDate, EndDate, Metrics);
request.Dimensions = Dimensions;
request.Segment = Segment;
request.Sort = Sort;
request.StartIndex = StartIndex;
request.MaxResults = MaxResult;
GaData results = request.Fetch();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!