Skip to main content
CleverTapChange your setup in the sidebar

Step 3: Report screens

Report the current screen to Digia Engage on every visit, so CleverTap campaigns can target specific screens in your React Native, Android, iOS and Flutter app.

Tell Digia which screen the user is on, every time they arrive on it (including coming back to it). Campaigns can then show on specific screens.

With React Navigation, useFocusEffect runs each time a screen comes into focus:

import { useFocusEffect } from '@react-navigation/native';
import { useCallback } from 'react';
import { Digia } from '@digia-engage/core';

export function useScreenTracking(screenName: string) {
useFocusEffect(
useCallback(() => {
Digia.setCurrentScreen(screenName);
}, [screenName]),
);
}

// In each screen:
useScreenTracking('product_detail');

Using Expo Router, react-native-navigation, or no navigation library? See Reporting the Current Screen.

Screen names are case-sensitive. product_detail and ProductDetail are different screens. Your campaign team doesn't type these names: when they capture screens from a debug build, the dashboard lists the names your app reports, and they pick from that list. So the names in your code are the names they see.

Reporting screens through Digia also records the screen view in CleverTap (recordScreenView), so remove your own CleverTap screen-tracking call; you don't need both.