protected override void OnNavigatedFrom(NavigationEventArgs e) { //當使用者離開頁面時, 將資料記錄下來做分析 var telemetry = new TelemetryClient(); PageViewTelemetry pvT = new PageViewTelemetry("ViewedUVDetailView"); TelemetryConfiguration.Active.TelemetryChannel.DeveloperMode = true; telemetry.Context.Device.Id = BasicInfo.DeviceID; telemetry.Context.User.Id = BasicInfo.UserName; telemetry.TrackPageView(pvT); }
protected override void OnNavigatedFrom(NavigationEventArgs e) { TelemetryClient telemetry = new TelemetryClient(); TelemetryConfiguration.Active.TelemetryChannel.DeveloperMode = true; PageViewTelemetry pvT = new PageViewTelemetry("ViewedMapView"); telemetry.Context.Device.Id = BasicInfo.DeviceID; telemetry.Context.User.Id = BasicInfo.UserName; pvT.Duration = DateTime.Now.Subtract(startViewTime); telemetry.TrackPageView(pvT); }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. /// This parameter is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { TelemetryClient telemetryclient = new TelemetryClient(); telemetryclient.TrackPageView("MainPage"); // TODO: Prepare page for display here. // TODO: If your application contains multiple pages, ensure that you are // handling the hardware Back button by registering for the // Windows.Phone.UI.Input.HardwareButtons.BackPressed event. // If you are using the NavigationHelper provided by some templates, // this event is handled for you. }
public void TrackPageViewSendsGivenPageViewTelemetryToTelemetryChannel() { var sentTelemetry = new List <ITelemetry>(); TelemetryClient client = this.InitializeTelemetryClient(sentTelemetry); var pageViewTelemetry = new PageViewTelemetry("TestName"); client.TrackPageView(pageViewTelemetry); var channelPageView = (PageViewTelemetry)sentTelemetry.Single(); Assert.Same(pageViewTelemetry, channelPageView); }
/// <summary> /// Track page view /// </summary> /// <param name="pageName"></param> public void ReportPageView(string pageName) { TelemetryClient client = new TelemetryClient(); client.TrackPageView(pageName); }
public async Task Initialize() { try { telemetryClient = new TelemetryClient(); telemetryClient.InstrumentationKey = "23694f6c-53c2-42e2-9427-b7e02cda9c6f"; telemetryClient.Context.Component.Version = Process.GetCurrentProcess().MainModule.FileVersionInfo.FileVersion; telemetryClient.Context.Session.Id = Guid.NewGuid().ToString(); telemetryClient.Context.Device.OperatingSystem = Environment.OSVersion.ToString(); telemetryClient.TrackPageView("Home"); telemetryClient.Flush(); } catch (Exception ex) { Trace.TraceError("Couldn't initialize telemetry: " + ex); } // Check for updates await CheckForUpdates(); SelectedMirrorProvider = MirrorProviders.First(); apps = (await applicationEnumerator.GetInstalledApplications()).ToList(); if (!apps.Any()) { Trace.TraceWarning("No BitTorrent applications found."); return; } foreach (var result in apps) { Trace.TraceInformation("Found app {0} version {1} at {2}", result.Description, result.Version, result.InstallLocation); } }