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

Sentry Cocoa WebView Trace Tracking

Sentry Cocoa WebView trace tracking: use 9.33.0 WKWebView propagation to join in-app web page slowness to the native session that opened it.

· 3 min read

Many iOS apps hide a web page behind a native screen: help centres, checkout steps, terms, embedded dashboards. When one of those pages is slow, the native trace ends at the moment the web view opens. Users blame your app, but your performance data says nothing happened.

Sentry Cocoa 9.33.0 adds WebView trace propagation. It connects the trace of a WKWebView page to the trace of the app that opened it, and it is also exposed through SentryObjC. That means a slow web step can finally be followed from the tap that started it.

The same release changes the experimental MetricKit report enum and stops sending animationScrollHitchTimeRatio on iOS and macOS 27 and later. If you chart either, check your dashboards after upgrading.

Data Points to Track

  • trace_id shared by the native screen and the web page
  • webview_url_path without query strings or personal data
  • webview_load_ms from navigation start to finish
  • webview_error_count per page
  • entry_screen that opened the web view
  • webview_purpose: help, checkout, legal, content
  • propagation_status: connected or missing
  • sentry_cocoa_version
  • session_outcome after the web step: completed, abandoned or returned

Setup Steps

  1. List every web view in your app and name its purpose.
  2. Upgrade to Sentry Cocoa 9.33.0 and read the release notes for the breaking MetricKit change.
  3. Enable trace propagation for the web view hosts you own. Do not propagate to third-party domains.
  4. Add the web-side SDK to those pages so they can continue the trace.
  5. Open each web view on a test build and confirm one trace spans both sides.
  6. Strip query strings and identifiers from recorded URLs.
  7. Create a dashboard of web view load time by purpose and entry screen.

Actionable Insights

Start with the slowest web views by purpose. A checkout page that takes four seconds longer than a help page is a revenue problem, not a polish item.

Next, compare completion rates for sessions with fast and slow web steps. If completion falls steeply above a certain load time, you have a target for performance work.

Look at the propagation status. Any web view reporting missing links either lacks the web SDK or points at a host you excluded. Fix those first, since they are still blind spots.

Finally, check whether errors cluster on a specific entry screen. A web page that fails only when opened from one native screen usually points at missing parameters or an expired session.

Common Mistakes to Avoid

Propagating trace headers to every domain leaks internal identifiers to third parties. Limit it to hosts you control.

Do not compare web view time with native screen time as if they were the same. Web loads depend on network and content, so use separate targets.

Remember that the MetricKit enum change can break an exhaustive switch at compile time. Test the upgrade on a branch before it reaches release builds.