Before you start
You need three things:- The Atatus Flutter SDK set up in your application. See Flutter Monitoring Setup.
- The Atatus Browser Agent running on the pages you load in the WebView. Without it there are no web events to correlate.
- JavaScript enabled in the WebView. The bridge between the page and the native SDK is JavaScript.
Choose a package
Two packages are available, one for each WebView library:
Use the one that matches the WebView library your application already depends on.
Track a webview_flutter WebView
Add the package alongside the core plugin:trackAtatusEvents on your controller, passing the SDK and the hosts you want correlated:
Track a flutter_inappwebview WebView
Add the package alongside the core plugin:InAppWebView, pass the script in initialUserScripts and register the handler in onWebViewCreated:
InAppBrowser, subclass it and register the handler in onBrowserCreated:
AtatusInAppWebViewUserScript in the browser’s initialUserScripts.
Sample the logs from a page
trackAtatusEvents accepts logSampleRate, a percentage from 0.0 to 100.0 that defaults to 100.0. Lower it when a page is chatty and you only want a share of its logs:
InAppBrowser is not tracked on Android 13 (API 33) and above in older versions of flutter_inappwebview. If your browser events are missing on newer devices, move to a version of the package built against flutter_inappwebview 6.2.0 or later. InAppWebView is not affected.Allowed hosts
Both packages take a list of hosts, and only pages served from those hosts are correlated with the native session. A host matches itself and its subdomains, soexample.com also matches shop.example.com.
Wildcards and regular expressions are not supported. Pass bare host names with no scheme and no path:
Verify the setup
Open a WebView in a debug build and load a page that runs the browser agent. In your Atatus dashboard, open the native session and confirm the views from the page appear inside it rather than as a separate session. If they do not, check these in order:- JavaScript is enabled in the WebView.
- The page host is in the allowed hosts list, spelled exactly.
- The browser agent is initialized on the page.
Limitations
Two limits are worth knowing before you plan around this feature:- Session Replay does not capture WebView content. The recorder walks the Flutter widget tree, so a WebView appears as an opaque region in the replay. RUM events from the page are still collected.
- Neither package supports Flutter Web.
Next steps
- Track the requests your application makes with Flutter Network Tracking.
- Set up the browser side with the Atatus Browser Agent.
- Record what your users saw with Flutter Session Replay.