Skip to main content

Screen Tracking (RUM)

Automatically track the screens users move through so you can visualise journeys and drop-off under RUM → User Flows in the dashboard. Integration is two lines: initialise once, attach the navigator observer.

Install

http is included as a dependency of the SDK. No extra packages are required.

Set up

Initialise SimplrRUM once at startup and attach SimplrScreenObserver to your app's navigator. That's it — every screen change is captured automatically.

import 'package:flutter/material.dart';
import 'package:simplr_fraud/simplr_fraud.dart';

final rum = SimplrRUM();

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

await rum.initialize(
apiKey: 'pk_your_public_key',
applicationId: 'my-mobile-app',
endpoint: 'https://your-api-host/v1/rum/events',
environment: 'production',
);

runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});


Widget build(BuildContext context) {
return MaterialApp(
navigatorObservers: [SimplrScreenObserver(rum)],
// ... your routes
);
}
}

The SDK automatically tags each event with the channel (ios or android) and basic device context (OS + version), so flows can be filtered by platform in the dashboard.

Naming screens

Screen names come from the route's name. Name your routes for readable flows:

// Named routes
MaterialApp(
routes: {
'/': (_) => const HomeScreen(),
'/checkout': (_) => const CheckoutScreen(),
},
);

// Or per-route settings
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => const CheckoutScreen(),
settings: const RouteSettings(name: 'Checkout'),
),
);

Unnamed routes fall back to Unknown — name the screens you care about.

Manual tracking (optional)

For custom navigation (tabs, nested navigators, wizards) you can report screens yourself:

rum.trackScreen('Checkout - Payment');

Identifying users (optional)

rum.setUser('user_123'); // associate subsequent events
rum.clearUser(); // e.g. on logout

How it works

  • A session is created on first use and persists across screens (30-minute inactivity timeout).
  • Each screen visit is recorded with its duration when the user leaves it.
  • Events are batched and sent to /v1/rum/events; the SDK also flushes when the app is backgrounded, so the last screen before the user leaves (a common drop-off point) is captured.

What you get

Once connected, journeys appear under RUM → User Flows — a branching map of screen-to-screen transitions with drop-off rates, filterable by channel. See User Flows.