-
public class WebViewTrackingAn entry point to Datadog WebView Tracking feature.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classWebViewTracking._InternalWebViewProxy
-
Field Summary
Fields Modifier and Type Field Description public final static WebViewTrackingINSTANCE
-
Method Summary
Modifier and Type Method Description final static Unitenable(WebView webView, List<String> allowedHosts, @FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float logsSampleRate, SdkCore sdkCore)Attach the bridge to track events from the WebView as part of the same session. final static Unitenable(WebView webView, List<String> allowedHosts, @FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float logsSampleRate)Attach the bridge to track events from the WebView as part of the same session. final static Unitenable(WebView webView, List<String> allowedHosts)Attach the bridge to track events from the WebView as part of the same session. -
-
Method Detail
-
enable
@MainThread()@JvmOverloads() final static Unit enable(WebView webView, List<String> allowedHosts, @FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float logsSampleRate, SdkCore sdkCore)
Attach the bridge to track events from the WebView as part of the same session. This method must be called from the Main Thread. Please note that:
you need to enable the JavaScript support in the WebView settings for this feature to be functional:
webView.settings.javaScriptEnabled = trueby default, navigation will happen outside of your application (in a browser or a different app). To prevent that and ensure Datadog can track the full WebView user journey, attach a android.webkit.WebViewClient to your WebView, as follow:
webView.webViewClient = WebViewClient()The WebView events will not be tracked unless the web page's URL Host is part of the list of allowed hosts.
- Parameters:
webView- the webView on which to attach the bridge.allowedHosts- a list of all the hosts that you want to track when loaded in the WebView (e.g.logsSampleRate- the sample rate for logs coming from the WebView, in percent.sdkCore- SDK instance on which to attach the bridge.
-
enable
@MainThread()@JvmOverloads() final static Unit enable(WebView webView, List<String> allowedHosts, @FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float logsSampleRate)
Attach the bridge to track events from the WebView as part of the same session. This method must be called from the Main Thread. Please note that:
you need to enable the JavaScript support in the WebView settings for this feature to be functional:
webView.settings.javaScriptEnabled = trueby default, navigation will happen outside of your application (in a browser or a different app). To prevent that and ensure Datadog can track the full WebView user journey, attach a android.webkit.WebViewClient to your WebView, as follow:
webView.webViewClient = WebViewClient()The WebView events will not be tracked unless the web page's URL Host is part of the list of allowed hosts.
- Parameters:
webView- the webView on which to attach the bridge.allowedHosts- a list of all the hosts that you want to track when loaded in the WebView (e.g.logsSampleRate- the sample rate for logs coming from the WebView, in percent.
-
enable
@MainThread()@JvmOverloads() final static Unit enable(WebView webView, List<String> allowedHosts)
Attach the bridge to track events from the WebView as part of the same session. This method must be called from the Main Thread. Please note that:
you need to enable the JavaScript support in the WebView settings for this feature to be functional:
webView.settings.javaScriptEnabled = trueby default, navigation will happen outside of your application (in a browser or a different app). To prevent that and ensure Datadog can track the full WebView user journey, attach a android.webkit.WebViewClient to your WebView, as follow:
webView.webViewClient = WebViewClient()The WebView events will not be tracked unless the web page's URL Host is part of the list of allowed hosts.
- Parameters:
webView- the webView on which to attach the bridge.allowedHosts- a list of all the hosts that you want to track when loaded in the WebView (e.g.
-
-
-
-