Mobile SDK
Send in-app events and ad-attribution signals from iOS, Android, React Native and Flutter apps.
Mobile SDK
The Angler Mobile SDK sends your app's events straight to Angler, the way the Angler web pixel does on your website. It also sends the signals ad platforms need from an app: install and launch events, device details, advertising IDs (IDFA and GAID, with consent) and ad click IDs from deep links.
| Platform | Package | Install |
|---|---|---|
| React Native | @anglerai/react-native-analytics on npm | npm install @anglerai/[email protected] |
| Flutter | angler_analytics on pub.dev | angler_analytics: ^0.1.0-rc.4 |
| iOS (Swift) | AnglerAnalytics via Swift Package Manager | .package(url: "https://github.com/angler-ai/angler-mobile-sdk", exact: "0.1.0-rc.4") |
| Android (Kotlin, Java) | ai.getangler:analytics on Maven Central | implementation("ai.getangler:analytics:0.1.0-rc.4") |
All four share one version and behave the same way. The SDK is in release candidate: let us know before you ship it in a production app.
Before you start
You need your Angler workspace ID and a workspace token. Your Angler account manager can provide them, or see Create API Access Tokens.
Requirements:
- React Native: 0.76 or later with the New Architecture (the default since 0.76). Expo works in a development build, not in Expo Go.
- iOS: 15.1 or later. Android: minSdk 24.
- The SDK includes native code, so it ships in a new App Store or Play release.
Quick start (React Native)
Configure once at startup, outside any component, then track events as the shopper browses:
import { Angler, AnglerEvent } from '@anglerai/react-native-analytics';
Angler.configure({
workspaceId: '<workspace id>',
token: '<workspace token>',
appStoreId: '<your App Store ID>', // iOS; TikTok's app events need it
});
Angler.track(AnglerEvent.productViewed, {
data: { productVariant: { id: '41234567890', price: { amount: 29.5, currencyCode: 'USD' } } },
});app_installed and app_launched are sent automatically. Then, in every app:
- Track the shopping events:
product_viewed,collection_viewed,search_submitted,product_added_to_cart,cart_viewed,checkout_started,checkout_completed,registration_completedandlogged_in. Each takes a data object; the events and data objects reference lists what to send with each, with examples in every language. - On a purchase, pass the order ID as
eventIdand incheckout.order.id, so it isn't counted twice. - Call
Angler.setUserId('<customer id>')when the shopper logs in, andAngler.reset()when they log out. - Forward deep links, so click IDs from ads are captured. React Native does this for you through
Linking. - On iOS, show Apple's tracking prompt (ATT) yourself if you want the IDFA sent. The SDK never shows it.
Native iOS, Android and Flutter apps follow the same steps; see the guide for your platform below.
Web checkout and links from your website
- Checkout on the web: if checkout runs on your website (for example Shopify's checkout in a web view), pass
await Angler.getClientId()to it as the cart attribute_angler_client_id, so the order is linked to the app. - "Open in app" links from your website: add the visitor's browser IDs to the link, named after their cookies, for example
myapp://product/42?_fbp=<_fbp cookie>&_fbc=<_fbc cookie>&_ga=<_ga cookie>. The app keeps them and sends them with every later event, so the visitor's web sessions are tied to the app. This only works when the app is already installed.
Check it works
Add debugLogging: true to configure and watch the Xcode console or adb logcat -s Angler for queued app_launched and delivered … event(s). HTTP 401 or 403 means the workspace ID or token is wrong. To test without touching production data, add domain: 'dev-data.getangler.ai' and ask us for a dev workspace.
Privacy
- Update your App Store privacy details and your Google Play data safety form. The SDK's README lists what it collects. On iOS the package ships a privacy manifest.
Angler.setEnabled(false)stops collection and deletes queued events, and is remembered across launches.
Guides and source
- GitHub repository: what the SDK collects, every event, delivery and configuration.
- Platform guides: React Native, Flutter, iOS, Android.
- Events and data objects, with an example for every object.
- Example apps: React Native, Flutter, iOS, Android.
- Releases and issues.
Already using AppsFlyer? You can also send AppsFlyer data to Angler.
Updated about 3 hours ago
