How to Add Affiliate Tracking to Your Superwall App
Connect Superwall to Appfiliate for automatic affiliate attribution on paywall conversions. Track which creators drive subscriptions through your Superwall paywalls.

Superwall makes it easy to build, test, and optimize paywalls. It handles the presentation layer well. But when a creator drives an install that converts through one of your Superwall paywalls, you have no idea which creator deserves the credit.
That is the gap. Superwall tells you which paywall variant converted. Appfiliate tells you which creator sent the user in the first place. Connect the two, and you can see that Creator A drove 200 installs last month, 38 of which hit your paywall and 14 converted to paid subscribers. That is the data you need to run a real Superwall affiliate integration.
This guide walks through connecting Superwall to Appfiliate so that every paywall conversion is automatically attributed to the creator who drove the install. The integration takes about fifteen minutes and requires no IDFA, no ATT prompt, and no manual purchase tracking code.
How the integration works
The flow is straightforward:
- A creator shares their unique Appfiliate link.
- A user clicks the link and installs your app.
- The Appfiliate SDK matches the link click to the install using device signals (no IDFA required).
- When the user subscribes through a Superwall paywall, Superwall fires a webhook to Appfiliate.
- Appfiliate matches the subscription event to the original creator using the user ID you set in code.
trackPurchase() calls in your code. No manual reconciliation. The webhook handles everything.
Step 1: Add the Appfiliate SDK
First, add the Appfiliate SDK to your project. Pick the tab that matches your platform.
iOS (Swift)
Add the Swift Package in Xcode:
- Go to File > Add Package Dependencies
- Paste the repository URL:
https://github.com/Appfiliate-sdk/appfiliate-ios-sdk - Select version 1.0.0 or later
- Click Add Package
Android (Kotlin)
Add JitPack to your settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Then add the dependency to your app's build.gradle.kts:
dependencies {
implementation("com.github.Appfiliate-sdk:appfiliate-android-sdk:1.0.0")
}
Flutter (Dart)
Add to your pubspec.yaml:
dependencies:
appfiliate: ^1.0.0
Run flutter pub get.
React Native
npm install appfiliate-react-native
Step 2: Initialize the SDK and set the user ID
This is the critical step. You need to do two things on app launch: track the install and link the user to their Superwall identity. The user ID is what connects the install attribution to the webhook events that Superwall sends later.
iOS (Swift)
import Appfiliate
import SuperwallKit
// In your App init() or AppDelegate didFinishLaunchingWithOptions:
Appfiliate.configure(appId: "APP_ID_HERE", apiKey: "API_KEY_HERE")
Appfiliate.trackInstall()
Appfiliate.setUserId(Superwall.shared.userId)
Android (Kotlin)
import com.appfiliate.sdk.Appfiliate
import com.superwall.sdk.Superwall
// In Application.onCreate() or main Activity.onCreate():
Appfiliate.configure(this, appId = "APP_ID_HERE", apiKey = "API_KEY_HERE")
Appfiliate.trackInstall(this)
Appfiliate.setUserId(this, Superwall.instance.userId)
Flutter (Dart)
import 'package:appfiliate/appfiliate.dart';
// In main() or initState():
Appfiliate.configure(appId: 'APP_ID_HERE', apiKey: 'API_KEY_HERE');
await Appfiliate.trackInstall();
await Appfiliate.setUserId(Superwall.shared.userId);
React Native
import { appfiliate } from 'appfiliate-react-native';
// On app startup:
appfiliate.configure({ appId: 'APP_ID_HERE', apiKey: 'API_KEY_HERE' });
await appfiliate.trackInstall();
await appfiliate.setUserId(Superwall.shared.userId);
Replace APP_ID_HERE and API_KEY_HERE with the credentials from your Appfiliate dashboard. You can find these under your app's settings.
A few things to note:
trackInstall()only fires once per install. It is safe to call on every app launch.setUserId()links the Superwall user identity to the Appfiliate attribution record. This is what allows the webhook to match subscription events to the correct creator.- If you are using RevenueCat alongside Superwall, you can use either the Superwall user ID or the RevenueCat
appUserID. Just be consistent with what Superwall sends in the webhook payload.
Step 3: Add the webhook URL in Superwall
This is where the automation happens. Instead of calling trackPurchase() in your code every time a user subscribes, Superwall sends the event data directly to Appfiliate via webhook.
- Open the Superwall dashboard
- Navigate to Integrations > Webhooks
- Paste this webhook URL:
https://us-central1-appfiliate-5a18b.cloudfunctions.net/api/v1/webhooks/superwall?secret=YOUR_WEBHOOK_SECRET
Replace YOUR_WEBHOOK_SECRET with the webhook secret from your Appfiliate dashboard. You can find it under Settings > Integrations > Superwall.
That is the entire integration. Three lines of code in your app, one URL in the Superwall dashboard.
What events are tracked
Once the webhook is connected, Appfiliate automatically processes the following Superwall events:
- New subscriptions, when a user converts through a Superwall paywall, the subscription is attributed to the creator who drove the install.
- Renewals, recurring payments are tracked and attributed to the original creator, so you can see lifetime revenue per creator, not just the initial conversion.
- Cancellations, when a subscriber churns, the cancellation is recorded against the creator's attribution record. This helps you identify which creators drive high-quality, long-retention subscribers versus those who drive users that cancel quickly.
Why this matters for your creator program
If you are running Superwall, you are already investing in paywall optimization. You are experimenting with paywalls, tweaking prices, doing A/B tests. But what about acquisition? What are your best subscribers made of?
With Superwall integrated as an affiliate source in Appfiliate, you can answer questions like:
- Which creators generate the most paywall conversions (not just app installs)?
- What is the revenue per creator for the past 30, 60, or 90 days?
- Which creators generate subscribers with the highest LTV?
- Which creators perform best on which paywall variant?
Check our pricing page for plan details or browse other integrations if you use other subscription platforms besides Superwall.