I'm writing this Console Application to get some basic "Google Analytics Api-data" logic going. Everythings works fine but i wan't to add some more metrics to query to google analytics API. I wan't to add ga:newvisitors, ga:reaccuringvisitors etc. How do i implement this in the code below?
Here's a relevant piece of the code:
var gas = new AnalyticsService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "TestGoogleAnalytics",
});
var r = gas.Data.Ga.Get("ga:ProfileID", "2010-02-24", "2014-02-24", "ga:visitors");
//Specify some addition query parameters
r.Dimensions = "ga:pagePath";
r.Sort = "-ga:visitors";
r.MaxResults = 10000;
//Execute and fetch the results of our query
Google.Apis.Analytics.v3.Data.GaData d = r.Execute();
foreach (KeyValuePair<string, string> kvp in d.TotalsForAllResults)
{
Console.WriteLine("Total Visitors:" +" " + kvp.Value);
}
Console.WriteLine(d.TotalsForAllResults.Keys + " = " + d.TotalsForAllResults.Values);
Console.ReadLine();
Thanks