In-app events for hybrid apps

In-app events give you comprehensive data about user activity. Hybrid apps, that combine native views and HTML content, can record in-app events by calling AppsFlyer's SDK API using Javascript.

This guide explains how to bridge the gap between the HTML view and the native view, effectively allowing you to record in-app events from HTML or web view.


You have a hybrid app that offers subscriptions. You implement the subscription form in a web view which actually loads from your website.

You can record the subscription in-app event in the web view and send data related to it (such as type of subscription, price etc.) to the native code.

The native code collects the data and uses AppsFlyer's SDK to send the subscription in-app event.

Recording in-app events in hybrid apps

In this guide we provide two methods for recording in-app events in hybrid apps:

Native javascript interface

The native javascript method is the recommended one. It uses the native javascript interface in order to establish communication between the HTML or web view and the native code.

This way you can send in-app event related data from the web view to the native code. Once the native code obtains the data it sends it to AppsFlyer using AppsFlyer's SDK.

URL loading method

In the url loading method, the native code listens to url loading events.

You can set the native code to listen to loading events of specific urls and extract data from the url parameters. The data is then is passed to AppsFlyer's SDK.


Was this article helpful?