Skip to main content
← Back to blog
Felix Cameron··8 min read

How to Track App Installs in Your iOS App

Add install and revenue tracking to your iOS app in under 10 minutes. See exactly which links drive downloads, with no IDFA and no ATT prompt required.

Why do you need to track installs per link?

You probably promote your app via many different avenues like your bio link, a creator’s YouTube video, a blog post, a reddit comment, etc. But which links are actually driving the most installs? Or better, paying users?

Without per link tracking, you’ll have to guess. You might know how many total installs you have via App Store Connect, but no way of knowing whether this was from one of your posts. With Instally you can see exactly which links are driving installs and how many paying customers, all down to the link level. For context on how Instally compares to enterprise MMPs, see our primer on tracking installs without an MMP. For the broader framework of how per-link install tracking works across every channel, see the full guide on tracking app installs with links.

Here’s a guide on setting up the Instally iOS SDK in your Swift or SwiftUI app.

What you’ll need to get started

You’ll need a few things to follow along.

RequirementDetails
Instally accountFree tier works. Sign up here
Xcode 15+Swift 5.9 or later
iOS deployment targetiOS 15.0 minimum
An app on the App Store (or TestFlight)You need a bundle ID registered with Instally
10 minutesThat’s genuinely all this takes

Step 1: Add the Instally SDK

Install the SDK via Swift Package Manager. In Xcode, do the following:

    • Go to File > Add Package Dependencies
    • Enter the URL for the SDK: https://github.com/Instally-io/instally-ios-sdk
    • Select the version rule to Up to Next Major Version, from 1.0.0
    • Click Add Package
Alternately, you can add the SDK manually to your Package.swift file:

For Swift:

dependencies: [
    .package(url: "https://github.com/Instally-io/instally-ios-sdk", from: "1.0.0")
]

Now make sure to add the Instally dependency to your target:

.target(
    name: "YourApp",
    dependencies: ["Instally"]
)

Step 2: Configure the SDK on app launch

Import the SDK and then you’ll call configure as early as possible in your app’s lifecycle. You’ll need your app’s API key here, which you can find in the Instally dashboard under Settings > API Keys.

Swift example:

import Instally

@main
struct YourApp: App {
    init() {
        Instally.configure(apiKey: "your_api_key_here")
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

Or if you’re not using SwiftUI:

Swift example:

import Instally

class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        Instally.configure(apiKey: "your_api_key_here")
        return true
    }
}

configure just initializes the SDK. No ATT prompt, or IDFA required.

Step 3: Track the install

Once configured you call trackInstall on any given launch to send the install to Instally. Since the SDK takes care of deduplicating for you, you can just call this whenever the user opens the app!

Swift example:

import Instally

struct ContentView: View {
    var body: some View {
        Text("Welcome to the app")
            .onAppear {
                Instally.trackInstall { result in
                    switch result {
                    case .success(let installData):
                        print("Install tracked. Source: \(installData.linkSlug ?? "organic")")
                    case .failure(let error):
                        print("Install tracking failed: \(error.localizedDescription)")
                    }
                }
            }
    }
}

And finally, there is also an async/await variant you can use:

Swift:

Task {
    do {
        let installData = try await Instally.trackInstall()
        print("Install tracked. Source: \(installData.linkSlug ?? "organic")")
    } catch {
        print("Install tracking failed: \(error)")
    }
}

The installData holds the link slug (when the install came from a Instally link) and other metadata (like the country and type of device). When the install was organic or from a link not created by Instally, linkSlug is nil.

Attribution on iOS without IDFA

Instally does not use the IDFA, so no ATT prompt is required. Your users see nothing at all — tracking happens in the background once trackInstall has fired. Match rates are highest for users who install shortly after tapping your link, which is typical for creator, bio, and email traffic.

For the Android flow, see our Android integration guide.

Step 4: Revenue tracking (optional)

If you’re using RevenueCat to manage in-app purchases or subscriptions, Instally can tie back revenue to the link that brought them to the app. So instead of saying “creator a got us 200 installs”, you can say “creator a brought us $1,400 in revenue.” For a step-by-step walkthrough with dashboard screenshots, see the full RevenueCat integration guide.

There are two ways to set up revenue reporting:

Option A: RevenueCat webhook (recommended)

This is the easiest setup and requires no additional SDK setup. All you have to do is add your Instally webhook URL (https://api.instally.io/webhooks/revenuecat) to your webhook URL list in RevenueCat:

    • Login to your RevenueCat Dashboard
    • Click on Integrations > Webhooks
    • Add Webhook URL: https://api.instally.io/webhooks/revenuecat
    • Add header X-Instally-Api-Key with your API key
    • Select events you would like to send to Instally: INITIAL_PURCHASE, RENEWAL, PRODUCT_CHANGE
Now RevenueCat will automatically send any purchase events we receive from Instally, and we will match them to the user install (and link) using the app user ID.

To match revenue to the app install correctly, you must use the Instally install ID as the app user ID in RevenueCat:

Swift:

Instally.trackInstall { result in
    if case .success(let installData) = result {
        Purchases.shared.logIn(installData.installyUserId) { _, _, _ in }
    }
}

Option B: Client-side revenue reporting

Alternatively, if you don't use RevenueCat, or just want to do client-side tracking, you can report revenue events directly like so:

Swift Example:

Instally.trackRevenue(
    amount: 9.99,
    currency: "USD",
    productId: "pro_monthly",
    transactionId: transaction.id
)

This will work with any payment provider, and should be called after your purchase goes through.

Step 5: Verify in the dashboard

Once you've pushed a build with the SDK included:

    • Create a test link in the Instally dashboard.
    • Navigate to that link on a test device.
    • Install the app and open it.
    • Navigate back to the Instally dashboard - you should see the click and install in your dashboard within a few seconds.
If you instead see the install attributed as "organic," make sure that you're calling configure prior to calling trackInstall, and that your device installed the app within 24 hours of you clicking the link.

Full working example

Here is a minimal but complete SwiftUI app that has both the install and revenue tracking set up:

Swift Example:

import SwiftUI
import Instally
import RevenueCat

@main
struct MyApp: App {
    init() {
        Instally.configure(apiKey: "ik_live_abc123")
        Purchases.configure(withAPIKey: "appl_xyz789")
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

struct ContentView: View {
    @State private var source: String = "loading..."

    var body: some View {
        VStack(spacing: 16) {
            Text("Install source: \(source)")
                .font(.headline)
        }
        .task {
            do {
                // Get the install from Instally. If this is an organic install,
                // `linkSlug` will be null.
                let install = try await Instally.trackInstall()
                
                // Sync the Instally user ID with RevenueCat
                source = install.linkSlug ?? "organic"
                try await Purchases.shared.logIn(install.installyUserId)
            } catch {
                // We had an error during tracking.
                source = "error"
            }
        }
    }
}

FAQ

Does the SDK require the IDFA or trigger an ATT prompt?

No. Instally never requests access to the IDFA, so the "Allow to track" ATT prompt never shows. Matching happens in the background with no user-facing disclosure.

How accurate is install matching on iOS?

With links where a click happens and an install happens within a few hours, match rates are typically above 90%. As the number of hours between click and install increases, we get a slightly lower match rate. For all organic installs (ones that do not originate from an Instally link) Instally does not attempt to track them as organic.

Does it work with TestFlight?

Absolutely! It works the exact same in TestFlight as it does in production, and you can use it to test your integration before releasing your app.

Can I track installs from multiple links?

Yes! Each link you create in Instally will have its own unique slug, and if an install is attributed to that link, then the linkSlug field will have that string, allowing you to know which link caused the install. There are no limits on how many links you can create (on paid plans).

What data does Instally send to their servers?

The SDK sends Instally a minimal, non-identifying payload needed for install matching. We do NOT send any of this data to other companies, and we do not collect IDFA, email addresses, or any other identifying user information. Please read our privacy policy to see a full summary of what we store.

Is there an SDK for other platforms?

Yes! We have SDKs for Android (Kotlin), Flutter, and React Native, as well as iOS (Swift). Head over to the docs to see how to integrate with any of these.

---

Install tracking does not have to be a month-long, enterprise-level project. Add our SDK, call two functions, and get a handle on which links are driving installs and revenue. You can check our pricing to see which plan works for your app.

Ready / v1.0

Stop guessing. Start shipping.

Track clicks, installs, and revenue from every link. Set up in five minutes.

Get started free