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

WebApp Integration

This feature is supported in React Native SDK version 3.28.0 and above, and Javascript SDK version 11.51.0 and above.

For information about WebApp, refer to the documentation.

When rendering your own website through WebView, you can use the settings below to use the Hackle JavaScript SDK included in the website identically to the Hackle React Native SDK functions without modifying the website code.

When WebApp Integration is configured, all events that occur within the WebView are collected through the React Native SDK.

The following steps are required for React Native WebApp Integration.

  1. Add @hackler/react-native-webview-plugin to your project.

  2. Add the bridge when rendering WebView in React Native.

1. Add Plugin

npm install --save @hackler/react-native-webview-plugin

iOS

cd ios
pod install

2. Inject WebView Bridge

Add HackleWebViewConfig to the nativeConfig props of the react native webview.

You can create a config using the createHackleWebViewConfig() function.

Integrating Auto-collected Events from WebView

The $page_view and $engagement that occur in the website inside the WebView are disabled by default. You can enable each auto-collected event by configuring HackleWebViewConfig when setting up the WebView bridge.

Configuration Options

Option
Description
Default
Supported Bridge Version

automaticScreenTracking

Whether to collect $page_view from the website

false

1.0.0 +

automaticEngagementTracking

Whether to collect $engagement from the website

false

1.0.0 +

automaticRouteTracking

Whether to automatically collect page information from the website

true

1.1.0 +

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

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

Last updated