For the complete documentation index, see llms.txt. This page is also available as Markdown.

WebApp Integration

This feature is supported in Android SDK 2.29.0 and above, and JavaScript SDK 11.24.1 and above.

For information about WebApp, see the documentation.

When rendering your own website via WebView, you can use the following configuration to use the Hackle JavaScript SDK included in your website with the same functionality as the Hackle Android SDK, without modifying the website code.

Once the bridge is configured, Hackle events generated in the WebView are collected through the Android SDK.

The WebView bridge only processes data passed as a bridge from the Hackle JavaScript SDK via the Android SDK's JavascriptInterface.

...
Hackle.app.setWebViewBridge(webView)
...

Integrating Auto-collected Events from WebView

This feature is supported in Android SDK 2.62.0 and above, and JavaScript SDK 11.51.0 and above.

$page_view and $engagement generated on websites within the WebView are disabled by default. You can enable each auto-collected event by configuring HackleWebViewConfig when setting up the WebView bridge.

val webViewConfig = HackleWebViewConfig
	.builder()
	.automaticScreenTracking(true)
	.automaticEngagementTracking(true)
	.build()
Hackle.app.setWebViewBridge(webView, webViewConfig)

Configuration Options

Option
Default
Description

automaticScreenTracking

false

Whether to collect $page_view generated on the website

automaticEngagementTracking

false

Whether to collect $engagement generated on the website

automaticRouteTracking

true

Whether to automatically collect page information generated on the website

To automatically collect $page_view and $engagement on page navigation, set automaticScreenTracking, automaticEngagementTracking, and automaticRouteTracking all to true.

To manually collect $page_view and $engagement on page navigation, set automaticScreenTracking and automaticEngagementTracking to true, and set automaticRouteTracking to false.

Last updated