Track your iOS app with DATALYR and see which channel, campaign and ad drove every install and conversion.
- Attribution. Click IDs, UTMs, Apple Search Ads and SKAdNetwork data are captured and kept with the install.
- One customer, every session. Anonymous app activity joins the signed-in user when you call
identify(). - Better ad signal. Conversions reach your ad platforms with the data they need to optimize.
- Privacy built in. App Tracking Transparency is respected, and a privacy manifest ships with the SDK.
The SDK supports iOS 13 and later.
Swift Package Manager:
- In Xcode, open File > Add Package Dependencies.
- Enter
https://github.com/datalyr/swift. - Select version 2.3.0.
- Add the
DatalyrSDKproduct to your app target.
Or add it to Package.swift:
.package(url: "https://github.com/datalyr/swift", from: "2.3.0")CocoaPods:
pod 'DatalyrSDK', '~> 2.3.0'Run pod install. Then open the generated .xcworkspace.
Find your API key in DATALYR under Settings → API. The key starts with dk_.
import DatalyrSDK
// At app launch
let config = DatalyrConfig(apiKey: "dk_your_api_key")
try await DatalyrSDK.shared.initialize(config: config)
// Track an action
await DatalyrSDK.shared.track("signup_started", eventData: ["plan": "pro"])
// Tie the install to your user after sign-in
await DatalyrSDK.shared.identify("user_123", properties: ["email": "user@example.com"])
// Record a conversion with its value
await DatalyrSDK.shared.trackPurchase(value: 49.0, currency: "USD", productId: "pro_monthly")
// On logout only
await DatalyrSDK.shared.reset()If your app uses RevenueCat or Superwall, connect their webhooks to DATALYR for subscription revenue. Do not send that revenue with trackPurchase().
- Delete the app from a test device or simulator.
- Install and open the app.
- In DATALYR, open Events.
- Confirm that an
app_installevent arrives within 30 seconds.
If no event arrives, set debug: true in DatalyrConfig. Then read the [Datalyr] lines in the Xcode console.
Your AI agent can install the SDK for you. Connect the agent to the DATALYR MCP server at https://mcp.datalyr.com/mcp. Then ask it to install tracking. See DATALYR MCP.
- iOS SDK reference: every method, option and event
- Changelog
- Other SDKs: Web · React Native · Node
- Bugs and feature requests: open an issue
- Security reports: see SECURITY.md
- Other questions: datalyr.com
MIT. See LICENSE.