Stitching analytics sessions across a hybrid app boundary
Hybrid iOS apps have a quiet observability problem. The native shell tracks one analytics session; the embedded WKWebView tracks another. To the user it’s one flow. In the data, it’s two unrelated sessions. Funnels break across the boundary, and session-scoped metrics get cut in half.
That’s wrong. One user doing one thing should produce one session.
The fix is architectural. Pick one side to own the session, and have the other adopt it. Which side wins depends on the codebase. It doesn’t matter for the pattern. What matters is that one side is the source of truth, and the other follows.
After that, the work is keeping the two in sync across the awkward moments: session rotations, cold starts, one side restarting while the other is still running.