No third-party dependencies are needed. The client uses
URLSession and Apple frameworks (AdSupport, AppTrackingTransparency, AdServices, StoreKit). It targets iOS 15 and above.1. Configure Info.plist
To collect the IDFA, add a tracking usage description. Without it, iOS will not show the App Tracking Transparency prompt and the IDFA stays empty.2. Add the client
CreateLinkrunnerClient.swift. It authenticates with your project token in the request body.
3. Initialize and read attribution
Callconfigure once, then initialize, then poll attributionData.
4. Identify the user
Callsignup when the user signs up or logs in. Events and payments are only stored for attributed users.
5. Track events and payments
Add
amount as a number in event or payment data to enable revenue sharing with Google and Meta.Other endpoints
SKAdNetwork
init, signup, capture-event, and capture-payment responses can include a conversion value (fine_conversion_value, coarse_conversion_value, lock_postback). The client applies it automatically through applySKAN, which calls SKAdNetwork.updatePostbackConversionValue. You do not need to manage conversion values yourself. See Collecting device data for how this fits with Apple’s attribution.
Retries and idempotency
The client retries failed requests up to 3 times with exponential backoff (1s, 2s, 4s). It retries on network errors and on HTTP408, 429, and 5xx. Other responses, such as 400 or 401, are not retried.
A retry can send the same request twice if the first attempt reached the server but the response was lost. How that is handled depends on the endpoint:
Troubleshooting
Attribution data is always organic
Attribution data is always organic
Make sure
initialize ran on the device, not your backend. For Apple Search Ads, confirm adservices_attribution_token is present in device_data. The IDFA helps but only after the user grants App Tracking Transparency. See Collecting device data.IDFA is always empty
IDFA is always empty
The IDFA is only available after the user authorizes tracking. Add
NSUserTrackingUsageDescription and call requestTrackingAuthorization() while the app is active.Events or payments do not appear
Events or payments do not appear
Events and payments are only stored for attributed users. Call
signup first, and use the same install_instance_id everywhere.Every install looks like the same device or location
Every install looks like the same device or location
You are likely calling from your backend. The server matches on the calling IP, so calls must come from the user’s device.