Screen Views

Record screen-view events with the Ansight .NET SDK to improve session reconstruction, flow analysis, and AI summaries.

Ansight has dedicated screen-view helpers:

  • Runtime.ScreenViewed(string screenName)
  • Runtime.ScreenViewed(string screenName, string details)
  • Runtime.ScreenViewed(string screenName, byte channel)
  • Runtime.ScreenViewed(string screenName, byte channel, string details)

These are recorded as AppEventType.ScreenViewed.

Screen-view events are especially useful when you want Ansight or an AI agent to reconstruct a session later. They give the analysis pipeline explicit navigation breadcrumbs, which improves session timelines, flow reconstruction, and AI-generated summaries.

Minimal Example

Runtime.ScreenViewed("CheckoutPage");
Runtime.ScreenViewed("OrderSummaryPage", "route=/orders/summary");

.NET MAUI Page Example

When a MAUI app initializes through builder.UseAnsight<App>() or builder.UseAnsight(options), Ansight registers automatic page-view telemetry. It listens for Application.PageAppearing and records the page type name with Runtime.ScreenViewed(...).

Apps using the MAUI all-in-one path do not need to add Runtime.ScreenViewed(...) to every page for the default page-view stream.

Use manual calls only when you are not using the MauiAppBuilder integration, or when you want a custom screen name or details payload:

using Ansight;

public partial class CheckoutPage : ContentPage
{
    protected override void OnAppearing()
    {
        base.OnAppearing();
        Runtime.ScreenViewed(nameof(CheckoutPage), "route=/checkout");
    }
}

That keeps the custom event tied to the actual page presentation instead of navigation intent.

When To Use details

Use details for route or presentation metadata you may want later during analysis:

  • route=/checkout
  • presentation=modal
  • tab=profile
  • entry=push-notification

Keep it compact and structured.

Better screen metadata produces better summaries. If your app records stable screen names plus lightweight route or presentation details, downstream analysis can extract much richer user-flow metadata.