Troubleshoot screen_view event
1. Confirm prerequisites
Ensure your app integrates NotifyVisitors Android SDK v5.5.2+. If you’re below this, screen_view will never fire.
2. Pick your tracking mode per screen
NotifyVisitors provides Automatic or Manual mode for tracking screen_view event in Native SDK. For Hybrid SDK, automatic mode is not supported.
Check below what mode is set in your app.
- Automatic (Recommended for Activities):
- Logs
screen_viewfor Activities out of the box. - Does not log Fragments or other custom navigations.
- Logs
- Manual (Required for Fragments/custom nav/sub-views):
- You explicitly call
trackScreen("YourScreenName"). - Best for Fragments, single-Activity apps with multiple sub-views, Compose navigation, or custom routers.
- You explicitly call
Note: Do not mix modes on the same screen. Mixing automatic + manual on one Activity leads to duplicate events.
3. Automatic mode – what to verify
-
Is automatic tracking enabled?
It’s enabled by default. If you previously disabled it, remove the manifest flag or set it totrue.```xml <!-- If present and set to false, automatic screen tracking is OFF --> <meta-data android:name="notifyvisitors_analytics_automatic_screen_tracking_enabled" android:value="true" /> ``` -
Activity-only scope
Auto mode tracks Activity transitions only. If you rely on Fragments or a custom NavHost without Activity changes, you won’t seescreen_view—switch those screens to manual (see next section).
4. Manual mode – correct placement (Fragment/Activity)
Always call trackScreen() in onResume() so the event aligns with the moment the screen becomes visible/interactive.
Fragment (Java)
@Override
public void onResume() {
super.onResume();
NotifyVisitorsApi.getInstance(requireContext()).trackScreen("LoanOptions");
}
Activity (Java)
@Override
protected void onResume() {
super.onResume();
NotifyVisitorsApi.getInstance(this).trackScreen("LoanOptions");
}
Why onResume()?
- It fires every time the user returns to the screen (back stack, tab switch, etc.).
- Calling in
onCreate()oronViewCreated()can miss returns, while calling inonPause()/onStop()is too late.
Naming tips
- Use stable, unique names (e.g.,
HomeScreen,ProductDetails,EMICalculator). - Keep names consistent across releases so analytics don’t fragment across near-duplicates.
5. Going full manual? Disable automatic to prevent duplicates
If you decide to manually track all screens, disable auto:
<!-- AndroidManifest.xml -->
<meta-data
android:name="notifyvisitors_analytics_automatic_screen_tracking_enabled"
android:value="false" />
After this, no Activities are tracked automatically—you are responsible for calling trackScreen() wherever appropriate.
