Client SDKs
RevenueCat Integration
Connect Audiencelab and RevenueCat so subscription purchases attribute to the Audiencelab install
Use this guide when your iOS app uses both the Audiencelab SDK and RevenueCat. Audiencelab joins RevenueCat purchase and renewal webhooks to the original install using a shared device id.
Requires Audiencelab iOS SDK 1.1.14 or later.
What you set up
- Audiencelab SDK initialized in the app
- RevenueCat Purchases SDK configured in the app
getRevenueCatAttributes()copied onto the RevenueCat subscriber before the first paywall- RevenueCat connected in the Audiencelab dashboard (webhook URL + signing secret)
- That webhook configured in the RevenueCat project
You do not need to call sendPurchaseEvent for RevenueCat-managed subscriptions. Renewals can attribute even when the app is closed.
1. Install and initialize
Install Audiencelab as usual (Installation) and initialize before any RevenueCat paywall:
import AudienceLabSDK
import RevenueCat
AudienceLabSDK.initialize(
apiKey: "YOUR_AUDIENCELAB_API_KEY",
options: AudienceLabOptions(
isDevelopmentMode: false,
isDebugEnabled: false
)
)
Purchases.configure(withAPIKey: "YOUR_REVENUECAT_API_KEY")Open the app at least once with a valid creative token path so Audiencelab can store device identity for later joins.
2. Pass Audiencelab identity into RevenueCat
After both SDKs are ready, and before the first paywall, copy Audiencelab's device id onto the RevenueCat subscriber. Safe to call on every cold start:
Purchases.shared.attribution.setAttributes(
AudienceLabSDK.getRevenueCatAttributes()
)getRevenueCatAttributes() returns a string map with:
| Key | Value |
|---|---|
audienceLabId | iOS Identifier for Vendor (ifv), when available |
Empty values are omitted. There is no RevenueCat SDK dependency inside Audiencelab; your app calls RevenueCat's setAttributes with the map Audiencelab returns.
Custom RevenueCat attribute keys must not start with $. audienceLabId is intentional.
3. Connect RevenueCat in the Audiencelab dashboard
In Audiencelab, open the app's integrations / data sources flow and connect RevenueCat:
- Enter your RevenueCat project id
- Save
- Copy the webhook URL and signing secret immediately (the secret is shown once)
Keep both values for the next step.
4. Add the webhook in RevenueCat
In the RevenueCat dashboard for that project:
- Open Integrations → Webhooks
- Add a webhook using the Audiencelab webhook URL
- Paste the Audiencelab signing secret as the webhook authorization / signing secret
- Enable at least:
INITIAL_PURCHASERENEWALNON_RENEWING_PURCHASE
Other event types can stay enabled; Audiencelab acknowledges them and skips ingest for v1.
5. Verify
- Cold-open the app so
getRevenueCatAttributes()runs after both SDKs initialize - Complete a sandbox purchase or trial conversion (converting with the app closed is the strongest test)
- Confirm the purchase appears in Audiencelab attributed to the install creative
Notes
- Device-local
total_purchase_valueonly updates fromsendPurchaseEvent. RevenueCat webhook purchases are recorded server-side and do not bump on-device cumulative totals. - Do not rely on RevenueCat
$idfvalone for the join. Always callgetRevenueCatAttributes()soaudienceLabIdis present on later webhooks.