For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tagless Data Capture

Automatically capture screen transitions and tap interactions without manual instrumentation for each event.

Step 1 : Set up the NetmeraAnalyticProvider

Wrap your app's root component with NetmeraAnalyticProvider and pass the navigation container via the navigationRef prop. The provider dynamically manages screen tracking and tap tracking based on the configuration received from the Netmera dashboard.

App.tsx
import {
  NavigationContainer,
  useNavigationContainerRef,
} from '@react-navigation/native';
import { NetmeraAnalyticProvider } from 'react-native-netmera';

export default function App() {
  const navigationRef = useNavigationContainerRef();

  return (
    <NetmeraAnalyticProvider navigationRef={navigationRef}>
      <NavigationContainer ref={navigationRef}>
        {/* your navigators */}
      </NavigationContainer>
    </NetmeraAnalyticProvider>
  );
}

Use a single provider: Only one NetmeraAnalyticProvider should be mounted at a time. The current screen name is stored in a module-level singleton; mounting multiple providers simultaneously will cause them to overwrite each other's screen state.

Step 2 : Choose your React Navigation setup

Dynamic API — React Navigation v6 / v7

The same setup applies to both versions of the Dynamic API: create a ref with useNavigationContainerRef() and pass it to both the Provider and the NavigationContainer.

Static API — React Navigation v7

In the Static API, the component created with createStaticNavigation uses React.forwardRef and accepts the ref prop directly.

Comparison

Feature
v6 Dynamic
v7 Dynamic
v7 Static

navigationRef required?

Required

Required

Required

Screen tracking

✅Yes

✅Yes

✅Yes

Action tracking

✅Yes

✅Yes

✅Yes

Step 3 : Check architecture compatibility

Feature
Status
Code

Screen tracking

Full

Detected via navigationRef

Pressable / TouchableOpacity

Full

Switch

Full

Value (true/false) logged when Collect Values is enabled in the dashboard

TextInput focus

Partial

See note below

FlatList / SectionList index

Full

Added automatically when Collect Values is enabled

Legacy Architecture (Paper)

The same setup applies as with New Architecture — navigationRef is required for both architectures.

Feature
Status
Note

Screen tracking

Full

navigationRef required

Pressable / TouchableOpacity

Full

Switch

Full

TextInput focus

Full

FlatList / SectionList index

Full

Added automatically when Collect Values is enabled

Step 4 : Review action tracking behavior

When autotracking detects a touch, it uses the following priority order to identify the component. If no value is found in the chain, the event is not logged.

Log format

Automatically supported components

Component
Identification Order
Note

Pressable

accessibilityLabel → testID → text

TouchableOpacity

accessibilityLabel → testID → text

TouchableHighlight

accessibilityLabel → testID → text

Switch

accessibilityLabel → testID

Value (true/false) logged when Collect Values is enabled in the dashboard

TextInput

accessibilityLabel → testID → placeholder

Logged on focus; content is not captured

FlatList items

accessibilityLabel → testID → text

Item index added automatically when Collect Values is enabled

SectionList items

accessibilityLabel → testID → text

Section and item index added when Collect Values is enabled

Step 5 : Add manual tracking for unsupported components

Autotracking works by inspecting the onPress and onValueChange props in the fiber tree of React Native's standard components (Pressable, TouchableOpacity, Switch).

Components that do not directly expose these props are not automatically tracked. Third-party components that internally use Pressable or TouchableOpacity and forward an accessibilityLabel can be tracked automatically.

Manual Tracking: Netmera.trackAction

Use Netmera.trackAction for interactions that are not automatically captured. The method automatically prepends the current screen name to the path.

Example: Third-Party Dropdown

Example: Gesture-Based Component

Step 6 : Apply best practices

Using accessibilityLabel

The most effective way to improve tracking quality is to add meaningful accessibilityLabel to interactive components. This is especially important for icon buttons and components without text content.

Not tracked

Tracked

Identifier choice comparison

Method
Stability
Note

accessibilityLabel

High

Language-independent; also improves screen reader support

testID

Medium

May be stripped from production builds

Text content

Low

Changes with copy updates or localization; path drifts

For TextInput

For TextInput components where accessibilityLabel or testID cannot be added, placeholder is used as a fallback. However, placeholder is locale-sensitive — prefer an explicit label when possible.

Last updated

Was this helpful?