Package 

Object WebViewTracking


  • 
    public class WebViewTracking
    
                        

    An entry point to Datadog WebView Tracking feature.

    • Method Summary

      Modifier and Type Method Description
      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.
      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.
      final static Unit enable(WebView webView, List<String> allowedHosts) Attach the bridge to track events from the WebView as part of the same session.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 = true
        • by default, navigation will happen outside 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 following:

        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.

        Each entry may be a plain host name (e.g. example.com) or a wildcard pattern containing a single *. A wildcard may only match subdomains of a registrable domain:

        • accepted: *.example.com, preview-*.example.com, *.example.co.uk

        • rejected: *, *.com, *example.com (too broad), *-preview.example.com (the * must end a label)

        Invalid entries are dropped and the reason is logged.

        Parameters:
        webView - the webView on which to attach the bridge.
        allowedHosts - a list of all the hosts (plain host names or wildcard patterns) 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 = true
        • by default, navigation will happen outside 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 following:

        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.

        Each entry may be a plain host name (e.g. example.com) or a wildcard pattern containing a single *. A wildcard may only match subdomains of a registrable domain:

        • accepted: *.example.com, preview-*.example.com, *.example.co.uk

        • rejected: *, *.com, *example.com (too broad), *-preview.example.com (the * must end a label)

        Invalid entries are dropped and the reason is logged.

        Parameters:
        webView - the webView on which to attach the bridge.
        allowedHosts - a list of all the hosts (plain host names or wildcard patterns) 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 = true
        • by default, navigation will happen outside 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 following:

        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.

        Each entry may be a plain host name (e.g. example.com) or a wildcard pattern containing a single *. A wildcard may only match subdomains of a registrable domain:

        • accepted: *.example.com, preview-*.example.com, *.example.co.uk

        • rejected: *, *.com, *example.com (too broad), *-preview.example.com (the * must end a label)

        Invalid entries are dropped and the reason is logged.

        Parameters:
        webView - the webView on which to attach the bridge.
        allowedHosts - a list of all the hosts (plain host names or wildcard patterns) that you want to track when loaded in the WebView (e.g.