Esempio n. 1
0
        private void GenerateSiteAccessReport()
        {
            int            i;
            StatisticModel tmpStat;

            AnalyticsReportService reportService = new AnalyticsReportService(MyMaster.GoogleReportingService);
            var dimensions = new List <Dimension> {
                new Dimension {
                    Name = "ga:year"
                }
            };
            var metrics = new List <Metric> {
                new Metric {
                    Expression = "ga:pageviews"
                },
                new Metric {
                    Expression = "ga:uniquePageviews"
                }
            };

            List <DateRange> dateRanges = new List <DateRange>();

            dateRanges.Add(new DateRange
            {
                StartDate = MyMaster.AnalyticsStartDate,
                EndDate   = DateTime.Now.ToString("yyyy-MM-dd")
            });

            var rows = reportService.GetStatisticsByMetrics(dateRanges, dimensions, metrics, MyMaster.AnalyticsIDView);

            foreach (ReportRow row in rows)
            {
                for (i = 0; i < row.Dimensions.Count; i++)
                {
                    tmpStat = new StatisticModel(row.Dimensions[i], row.Metrics[0].Values[0], row.Metrics[0].Values[1]);
                    ViewStatistics.Add(tmpStat);
                }
            }
        }
Esempio n. 2
0
        private void btnStatistics_Clicked(object sender, EventArgs e)
        {
            ViewStatistics viewStatistics = new ViewStatistics();

            this.Navigation.PushAsync(viewStatistics);
        }