Expo Router
Track screens automatically in apps that use Expo Router.
ExpoRouterTracker listens to route changes and records each screen, how long it stays visible and how many taps and swipes happen on it. Every other event is automatically tagged with the screen that was open at the time.
Setup
Mount it once, inside the provider, in your root layout.
import Constants from 'expo-constants';
import { ExpoRouterTracker } from '@riveora/react-native/expo-router';
<RiveoraProvider
projectKey="pk_your_project_key"
storage={storage}
appVersion={Constants.expoConfig?.version}
consent="granted"
>
<ExpoRouterTracker />
<Stack />
</RiveoraProvider>How screens are named
Screens are named after their route file, so one screen shows up once in the dashboard, not once per item. Dynamic parts like [id] become :id and groups like (tabs) are left out:
| Route the user opened | Screen in Riveora |
|---|---|
/product/8812 | /product/:id (file app/product/[id].tsx) |
/product/summer-sale | /product/:id |
/settings | /settings (file app/(tabs)/settings.tsx) |
/orders/3fa85f64-5717-4562-b3fc-2c963f66afa6 | /orders/:id |
/u/emily@example.com | /u/:identifier (emails never stored) |
/search?q=serum | /search (query string dropped) |
Options
| Prop | Type | Description |
|---|---|---|
screenAlias | Record<string, string> | Rename routes, e.g. { '/paywall': 'Paywall' }. Keys can be the raw path or the screen name, e.g. /product/:id. |
ignoreScreens | Array<string | RegExp> | Routes to skip entirely, matched against the normalized name. Useful for dev menus, e.g. [/^\/__/]. |
reportScreens | boolean | In development builds, send your app's list of screens (from your route files) so the dashboard shows every screen, including ones nobody has opened yet. Never sent from production builds. Default: true |
extraScreens | string[] | Extra screens to list, for screens the route files don’t show. |
Every screen, from the start
In development builds, the tracker reads your route files and sends the list of screens once per app version, so the dashboard shows every screen right after setup, including ones nobody has opened yet. Layouts, +not-found, +html and API routes are left out. Production builds never send it.
A screen that isn't in the list still shows up the first time someone opens it. If Expo Router ever changes how it exposes its routes, the list is simply skipped and screens keep appearing as they're opened.
Parts of a screen that aren’t routes
Bottom sheets, modals drawn inside a screen and in-screen tabs don’t change the route, so the tracker can’t see them. To track one as its own screen, call Riveora.screen('ProductSheet') when it opens. Events after that are tagged with it until the next screen change.
The Expo Router tracker lives in its own entry point, @riveora/react-native/expo-router, so apps without Expo Router never bundle it.