Screen View Tracking

Prerequisites

The screen_view event is supported only in NotifyVisitors Flutter Android SDK v1.4.0 or later. To enable screen view tracking, ensure that your Android app is integrated with SDK version 1.4.0 or above, as earlier versions do not capture this event.

Introduction

Screen view tracking lets you measure how users navigate through your Flutter app. By logging every screen a user visits, you gain insights into behavior patterns, engagement levels, and drop-off points.

In Flutter apps, screen tracking is not automatic. You need to manually trigger tracking by calling the trackScreenmethod whenever a screen comes into focus.

Manual Screen Tracking

To track a screen, place the following method in your widget’s lifecycle (commonly in initState() or when the screen is displayed).

// Import NotifyVisitors SDK
import 'package:notifyvisitors/notifyvisitors.dart';

class CheckoutScreen extends StatefulWidget {
  @override
  _CheckoutScreenState createState() => _CheckoutScreenState();
}

class _CheckoutScreenState extends State<CheckoutScreen> {
  @override
  void initState() {
    super.initState();

    // Track screen manually
    Notifyvisitors.shared.trackScreen("Checkout Screen");
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("Checkout")),
      body: Center(child: Text("Payment Details")),
    );
  }
}

Parameters

  • "Checkout Screen" → A unique identifier for the screen.
  • Use clear, consistent names (e.g., "HomeScreen""ProductDetails""CartScreen").
  • Consistency ensures accurate funnel tracking and reporting in analytics.

Triggering Logic

Each time trackScreen is called, the NotifyVisitors SDK records a screen_view event containing:

  • Screen name (passed in the method)
  • App version
  • Device and session context
  • User identity (if logged in)

This enables you to:

  • Reconstruct complete user journeys
  • Identify most-viewed screens vs. drop-off points
  • Trigger personalized campaigns (e.g., show nudges only on certain screens)

Example: BFSI App Use Case

In a banking/insurance app, you may want to track:

Notifyvisitors.shared.trackScreen("Policy List Screen");
Notifyvisitors.shared.trackScreen("Premium Calculator");
Notifyvisitors.shared.trackScreen("KYC Upload Screen");
Notifyvisitors.shared.trackScreen("Payment Gateway");
Notifyvisitors.shared.trackScreen("Policy Confirmation");

This flow helps you analyze:

  1. How many users explore policies
  2. How many calculate premiums
  3. How many drop off during KYC upload
  4. How many complete payments
  5. Overall conversion to policy confirmation

By identifying drop-offs, you can improve UX and send reminders or nudges at the right time.

Best Practice: Always call trackScreen at the entry point of each screen. Missing calls will result in incomplete journey data.