Ejemplo n.º 1
0
        public async Task TestTrackingPageVisits()
        {
            analytics.TrackPage("Main");
            analytics.TrackPage("LevelA / Sub");

            var receivedData = await PiwikMocker.SubmitAndReceive(analytics, url);

            Assert.That(analytics.UnsentActions, Is.EqualTo(0));

            var json = JObject.Parse(receivedData);
            var main = json["requests"][0].ToString();

            Assert.That(main, Does.Contain("action_name=Main"));
            var sub = json["requests"][1].ToString();

            Assert.That(sub, Does.Contain("action_name=LevelA+%2f+Sub"));
        }
Ejemplo n.º 2
0
        void TrackCurrentPage()
        {
            var path = "/" + string.Join("/", MainPage.Navigation.NavigationStack.Select(p => p.Title).ToArray());

            Analytics.TrackPage(MainPage.Navigation.NavigationStack.First().Title, path);
        }