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

I am currently developing a GA reporting application for my company using asp.net Google api V3 ( Google.Apis.Analytics.v3.dll ). I understand that there is an older version of .net api and some example for it, but when there is a newer version, I can use it. This next piece of code is how you send a request for GA data using Google.GData.Analytics.dll . But this is an older version.

AnalyticsService _service = new AnalyticsService("GoogleAnalytics");
_service.setUserCredentials("YourUsername", "YourPassword");
DataQuery dataQuery = new DataQuery(Conststr_Url);
dataQuery.Ids = "ga:xxxxxx";
dataQuery.Dimensions = "ga:date";
dataQuery.Metrics = "ga:visits";
dataQuery.GAStartDate = "2012-05-10";
dataQuery.GAEndDate = "2012-05-24";
DataFeed visits = _service.Query(dataQuery);
foreach (DataEntry entry in visits.Entries)
{
      Response.Write("Date: " + entry.Title.Text.Replace("ga:date=", "") + " Visits: " +   entry.Metrics[0].Value + "<br />");
}

3 oauth2, Tasks.ASP.NET.SimpleOAuth2, . google, , . , , , :). - exmaple.

.

+3
1

stackoverflow google , . , GetRequest AnalyticService , "GaData". :

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();
+3
source

All Articles