Skip to content

WebView Page Integration

Complete the integration in the order Configure App → Initialize Web Page → Verify Data. If the project has already completed App-side configuration, you can start directly from Page Initialization.

1. Configure App

First complete the SDK, RUM, and WebView Bridge configuration for the host platform, and allow the target page's host to use Bridge:

Host Platform App-side Configuration
Android WebView Monitoring
iOS WebView Data Monitoring
Flutter WebView Data Monitoring
React Native WebView Data Monitoring
HarmonyOS WebView Data Monitoring
UniApp WebView Data Monitoring

After completing these steps, continue with page initialization below.

2. Initialize Web Page

Choose one configuration based on how the page is used. If the page already integrates the Web SDK, reuse the existing loading method and keep only one initialization.

Page Usage Scope Initialization Method
Needs to collect data independently in a browser, or runs in both a browser and an App WebView Standard Integration (Recommended)
Used only within the App, with all data managed by the App SDK App-Embedded Pages Only

Standard Integration (Recommended)

Pages that already have a Web SDK initialization configuration can continue to use the existing configuration. For first-time integration, prepare the reporting configuration according to Web Manual Integration, then choose NPM or CDN to load the SDK.

When the page runs in a browser, it reports independently according to the Web SDK configuration. When it runs in an App WebView and Bridge is active, RUM data is handed over to the App SDK through FTWebViewJavascriptBridge. After initialization is complete, continue to Verify Data.

App-Embedded Pages Only (Special Case)

This method requires the host to enable Bridge before page initialization and to allow the current page to use it. Bridge mode automatically sets applicationId; you do not need to create a separate Web application.

Minimal Initialization Example for HTTP/HTTPS Pages

The following example includes SDK loading and RUM initialization and can be used for pages that have not yet integrated the Web SDK:

<script src="https://static.guance.com/browser-sdk/v3/dataflux-rum.js"></script>
<script>
  if (window.DATAFLUX_RUM) {
    window.DATAFLUX_RUM.init({
      // Satisfies initialization validation; RUM data is reported through the native Bridge.
      datakitOrigin: window.location.origin,
    })
  }
</script>

After completing these steps, continue to Verify Data.

3. Verify Data

  1. Open the integrated WebView page in the App and trigger a page view, click, or network request.
  2. In Real User Monitoring (RUM), select the corresponding App, and confirm that RUM data from the WebView page is received. In Bridge mode, data is reported by the App SDK; the /v1/write/rum request is not required to appear in the browser Network panel.

If no data is received, first confirm that the Web SDK is loaded, App RUM has been initialized, and Bridge was available and allowed the current host during page initialization. For platform configuration and troubleshooting entry points, see App-Side Configuration.

If the page also runs independently in a regular browser, check the browser scenario according to Web Integration Verification.

Optional: Session Replay

After RUM data verification passes, refer to the session replay configuration for your host platform:

Host Platform Configuration Entry
Android WebView Session Replay
iOS WebView Session Replay
Flutter Session Replay Initialization
React Native Session Replay Initialization
UniApp Session Replay Initialization

The dedicated WebView sections for Android and iOS describe how to enable page recording. After completing session replay initialization for cross-platform frameworks, refer to Web Session Replay for the page recording method. Supported scope and parameter descriptions are subject to the documentation for each platform.

Feedback

Is this page helpful?