# Track events from hybrid apps with the native mobile trackers
> Track events from both native mobile code and embedded WebViews in hybrid apps using unified session tracking.
> Source: https://docs.snowplow.io/docs/sources/mobile-trackers/hybrid-apps/
> Documentation index: https://docs.snowplow.io/llms.txt

> **Info:** This feature is available since v4. To use the Web plugin, you will need v6.1+ of the iOS or Android tracker.

Hybrid apps are mobile apps that in addition to a native interface, provide part of the UI through an embedded WebView. Snowplow events are tracked from both the native code (e.g., written in Swift or Kotlin) as well as the WebView (in JavaScript). Our goal is to have both events tracked from the native code as well as the WebView share the same session and appear as tracked with the same tracker.

## Event forwarding

We recommend using the Web tracker (v4.3+) to forward all Web events to the mobile tracker.

1. Implement the Snowplow iOS or Android tracker.

2. Implement the [Snowplow Web/JavaScript tracker](/docs/sources/web-trackers/) in the WebView in your app. Make sure to include the [WebView plugin](/docs/sources/web-trackers/tracking-events/webview/).

3. Subscribe to WebView event messages.

   **iOS:**

   ```swift
   // Pass in a WKWebViewConfiguration
   Snowplow.subscribeToWebViewEvents(with: webView.configuration)
   ```

   **Android (Kotlin):**

   ```kotlin
   // Pass in a WebView object
   Snowplow.subscribeToWebViewEvents(webView);
   ```

   **Android (Java):**

   ```java
   // Pass in a WebView object
   Snowplow.subscribeToWebViewEvents(webView);
   ```

   ***

4. Track events as usual.

The Web tracker will automatically intercept all web events and forward them to the mobile tracker. The forwarded events will have the tracker version from Web, e.g. "js-4.1.0", but will otherwise be tracked like the mobile events. They may contain additional information not present in the native mobile events, such as a browser useragent string or URL, or Web context entities e.g. the [WebPage entity](/docs/sources/web-trackers/tracking-events/page-views/#page-view-id-and-web_page-entity).

The forwarded events are filtered out of the Web tracker event queue so that they are not tracked twice.

With [screen context](/docs/sources/mobile-trackers/tracking-events/screen-tracking/#screen-view-event-and-screen-context-entity) enabled, the mobile tracker also adds its own `Screen` entity to forwarded events. If you enable the [`screenContextFromEvent` option](/docs/sources/mobile-trackers/tracking-events/screen-tracking/#keep-the-screen-an-event-was-triggered-on), forwarded events that already carry a screen entity from the JavaScript tracker keep it, and the mobile tracker doesn't add its own.

The WebView plugin uses the [Snowplow WebView tracker](/docs/sources/webview-tracker/) as a dependency.

## WebView Tracker

If you don't want to implement a Web tracker in your WebView, you can use the [Snowplow WebView tracker](/docs/sources/webview-tracker/) directly. This could be suitable if you only want to track a small number of events from the WebView. We recommend event forwarding for most use cases.

1. Implement the Snowplow iOS or Android tracker.

2. Implement the [Snowplow WebView tracker](/docs/sources/webview-tracker/) in the WebView in your app.

3. Subscribe to WebView event messages.

   **iOS:**

   ```swift
   // Pass in a WKWebViewConfiguration
   Snowplow.subscribeToWebViewEvents(with: webView.configuration)
   ```

   **Android (Kotlin):**

   ```kotlin
   // Pass in a WebView object
   Snowplow.subscribeToWebViewEvents(webView);
   ```

   **Android (Java):**

   ```java
   // Pass in a WebView object
   Snowplow.subscribeToWebViewEvents(webView);
   ```

   ***

4. Manually track [WebView events](/docs/sources/webview-tracker/).

All event types can be tracked with WebView tracker v0.3.0+, but it requires more work than using the event forwarding.
