WebView Data Monitoring¶
WebView RUM Data Monitoring¶
First complete SDK Initialization and RUM Configuration, then confirm the WebView collection switches and host configuration below.
Native RUM is controlled by FTRumConfig.enableTraceWebView, which defaults to YES; the app must still initialize RUM. Starting with SDK 1.6.8, WebView logs and RUM are controlled separately and share FTSDKConfig.allowWebViewHost.
Host Allowlist¶
Supported in SDK 1.6.8+
Set the allowlist before initializing the base SDK. Entries specify a host and do not include a scheme, port, or path. example.com allows that domain and its subdomains.
| Setting | Description |
|---|---|
nil |
Do not restrict hosts; allow all |
Empty array @[] / [] |
Do not allow any host |
| Non-empty array | Allow only matching hosts and their subdomains |
This allowlist controls RUM, Log, and Native Visitor ID access by the automatic WebView Bridge. Different features still need to be enabled separately; it does not replace the Web SDK's own initialization, logging, or request collection configuration.
The effective configuration precedence is: remote rumAllowWebViewHost > explicitly set FTSDKConfig.allowWebViewHost (including an explicit nil and an empty array) > legacy FTRumConfig.allowWebViewHost > unrestricted by default.
Starting with SDK 1.6.8, the legacy RUM host configuration is deprecated but retained as a compatibility fallback. For new integrations, configure it uniformly in FTSDKConfig; although the remote field still carries the rum prefix, in 1.6.8 it applies to the shared Bridge. Do not set different scopes through multiple configuration entry points at the same time.
Initialize Web Pages¶
After completing the app-side configuration above, proceed to Page Initialization, then check reporting according to WebView Data Verification.
To record WebView pages, see iOS WebView Session Replay.
WebView Logs¶
Supported in SDK 1.6.8+
Web pages also need to integrate the Browser Logs SDK that supports Native Bridge. Integrating Web RUM alone does not automatically generate Browser Logger logs.
Native Configuration¶
enableWebViewLog defaults to NO. It is independent of enableCustomLog, which controls Native custom logs, and of RUM's enableTraceWebView. Log sampling, level filtering, and RUM association configuration still need to be set as needed. To associate Native RUM, you should also initialize RUM and generate a valid View.
Web Configuration and Log Calls¶
import { datafluxLogs } from '@cloudcare/browser-logs'
datafluxLogs.init({
datakitOrigin: 'https://datakit.example.com', // Enter according to the Web Logs SDK configuration
service: 'app-webview',
env: 'prod',
sessionSampleRate: 100,
forwardErrorsToLogs: true,
forwardConsoleLogs: ['log', 'info', 'warn', 'error'],
})
datafluxLogs.logger.info('checkout opened', { page: 'checkout' })
console.info('checkout ready')
Calls such as logger.info directly generate Browser Logger logs; Console collection depends on the Web Logs SDK's forwardConsoleLogs, and JS error collection depends on its error collection configuration. The Native SDK does not read the WebView console as a substitute for the Web Logs SDK.
Remote configuration can use logEnableWebViewLog to dynamically control Native log reception. For details, see Remote Configuration Fields. Disabling Native log reception or blocking a host is not the same as disabling the Web SDK's own behavior; the page's independent reporting policy is still determined by the Web SDK configuration.
Native Visitor ID Sharing¶
After configuring a valid FTRumConfig.visitorIDConfig according to Visitor ID, a Web SDK that supports this capability can read the current ID through Native Bridge, without adding a separate "Share Visitor ID" switch.
- The current page must be allowed to establish a Bridge; access is controlled by the shared host allowlist above.
- The Native ID is provided only to the main frame; if access is denied or the feature is not enabled, no Native Visitor ID is returned.
- After the TTL expires or
FTSDKAgent.resetVisitorIDis called, subsequent reads use the new current ID; old values should not be permanently cached on the web side. - The Visitor ID URL rules control URLSession request header injection and are configured separately from the WebView host scope allowed to read the ID.