app_install, session_start, and session_end
without more code.
Before you start
You need a write key from Settings → API, and a development build you can install on a clean device or simulator.Do not load the web snippet inside a WebView as a replacement for an SDK. The web tracker
gets a separate
visitor_id and cannot read install attribution.Install
- iOS
- React Native
In Xcode, open File → Add Package Dependencies. Add
https://github.com/datalyr/swift. Add the DatalyrSDK product to your app target.Install
expo-modules-core in bare React Native too. The SDK loads a native module at
import time and throws without it.Set up the rest
1
Initialize once, at launch
Put the call in your app entry point. A second
initialize() creates a second SDK.2
Send a screen event on navigation
Call
screen(). It sends an event named pageview, not screen.3
Identify after sign-in
Pass the same user ID your backend and billing provider use.
4
Pass every deep link to the SDK
On iOS, call
handleDeepLink(url). React Native reads links on its own.5
Pass identity to your subscription SDK
Call
getRevenueCatAttributes() or getSuperwallAttributes() after both SDKs start.Subscription revenue
Mobile purchases reach Datalyr through RevenueCat or Superwall, not the SDK.Connect RevenueCat or Superwall, never both. Each writes the same event names for one
store transaction, so your reports add the same purchase twice.
Web-to-app campaigns
A campaign that lands on a website before the App Store needs web tracking on the landing page as well. Datalyr matches the two by email or by IP, and records$web_attribution_matched. See app campaigns.
Verify
- Delete the app, or reset the simulator.
- Launch a fresh install.
- Open Events in Datalyr.
- Confirm
app_installandsession_startarrive within 30 seconds. - Open one screen. Confirm a
pageviewarrives.
When no event arrives
Next
- iOS SDK: every method, option, and limit.
- React Native SDK: every method, option, and limit.
- Verify your setup: test through to a delivered conversion.