Product Benefits Pricing Guides Docs About Contact us Try it out
Performance

Sentry React Native WebView Trace Tracking

Sentry React Native 8.32.0 adds sentryWebViewProps to link app and WebView traces. Learn what WebView performance tracking to set up.

· 3 min read

Sentry React Native 8.32.0, released on 22 October, added sentryWebViewProps, a way to connect traces from your React Native app with the web pages running inside an embedded WebView. The same release stopped wrapping the SDK’s own RNSentry native module by default, because each wrapped call wrote to the native scope several times and added CPU time on iOS.

Why it matters: many apps hide key journeys inside WebViews, such as checkout, help centres, onboarding forms and account settings. Without a shared trace, the native app and the web page look like two unrelated systems. A slow payment screen shows up as “something is slow” with no way to tell whether the delay was in the app shell, the page load or your API.

What Goes Wrong Without It

Teams usually discover the gap during an incident. Support reports that checkout feels slow, the mobile dashboard looks healthy, and the web dashboard shows nothing for that user. Nobody can say which side owns the problem, so the investigation stalls.

Data Points to Track

  • webview_url: the page loaded, with query strings and personal data removed
  • webview_screen: the native screen or route that hosts the WebView
  • trace_id: the shared trace identifier passed from the app to the page
  • webview_load_ms: time from opening the WebView to the page being usable
  • webview_error_count: JavaScript errors raised inside the page
  • webview_exit_reason: completed, dismissed, error or timeout
  • app_version and sdk_version: to compare behaviour across releases
  • connection_type: such as wifi, 4g or 5g, to separate network from code issues

Setup Steps

  1. Upgrade @sentry/react-native to 8.32.0 or later and confirm tracing is enabled with a sensible sample rate.
  2. Install the Sentry browser SDK on the web pages you load inside the WebView, using a version that supports trace propagation.
  3. Spread sentryWebViewProps onto the WebView component, following the Sentry documentation for your WebView library.
  4. Open the WebView from a native screen with an active transaction so there is a trace to continue.
  5. Add webview_exit_reason and webview_load_ms as custom attributes so you can filter by outcome.
  6. Strip personal data from WebView URLs before they are sent, particularly tokens in query strings.
  7. Test one full journey on iOS and Android, then confirm the native and web spans appear in the same trace.

Actionable Insights

Find the real owner of slowness. When one trace shows the native shell, the page load and the API call, you can see which segment dominates. If page load is the long bar, the web team owns it. If the delay happens before the page starts, look at native navigation.

Compare WebView and native screens. If a WebView checkout completes far less often than a native one, the gap may be a performance problem rather than a design problem.

Watch exit reasons. A rise in timeout or dismissed exits after a release points to a regression you can trace to a specific build.

Check overhead after upgrading. Because 8.32.0 changes how the native module is wrapped, compare startup time and CPU for your own app before and after the upgrade.