How to Match RevenueCat App User IDs With Airbridge User and Device IDs

Match RevenueCat App User IDs and Airbridge Device IDs correctly using fetchDeviceUUID, setAirbridgeDeviceID, and Airbridge.setUserID before paywall.

Airbridge8 min read
How to Match RevenueCat App User IDs With Airbridge User and Device IDs

Key Takeaways

  • Two IDs Do Different Jobs: $airbridgeDeviceId (plus $idfa, $idfv, $gpsAdId, and $ip) connects RevenueCat webhooks to the original ad install, while matching RevenueCat's App User ID with Airbridge.setUserID() keeps user counts and cross-session funnels aligned.
  • Missing User IDs Inflate Subscriber Counts: If Airbridge cannot find a matching User ID from RevenueCat, it creates a random User ID—making unique subscriber totals higher than actual customers.
  • Timing Matters Most: Call collectDeviceIdentifiers(), setAirbridgeDeviceID(), and Airbridge.setUserID() right after SDK initialization and sign-in/sign-up, strictly before the user hits the paywall or triggers a purchase.
  • Update After iOS ATT Consent: On iOS 14.5+, call collectDeviceIdentifiers() again if the user accepts the App Tracking Transparency prompt so $idfa updates in RevenueCat.
  • Never Write Placeholder Campaign Values: If you optionally forward attribution fields ($mediaSource, $campaign, $adGroup, $ad, $keyword, $creative) to RevenueCat, never send placeholders like Organic or Unknown—those attributes are write-once per customer.

To match RevenueCat subscribers accurately to your Airbridge install cohorts, wire two identifiers before the user ever reaches your paywall: pass the Airbridge Device UUID (retrieved via fetchDeviceUUID) to RevenueCat using setAirbridgeDeviceID() alongside collectDeviceIdentifiers(), and send RevenueCat's App User ID to the Airbridge SDK via Airbridge.setUserID(). Skipping either step causes Airbridge either to lose campaign attribution on server-to-server renewals or to generate random fallback User IDs that inflate your subscriber counts.

Server-to-server subscription attribution solves the biggest blind spot in mobile marketing: renewals and trial-to-paid conversions happen on Apple and Google billing servers while your app is closed. Because RevenueCat dispatches those webhooks from its backend rather than the user's phone, Airbridge cannot rely on an active app session to guess which ad drove the purchase. It needs a reliable identity bridge between the device that clicked the ad and the customer profile billed by RevenueCat.

Getting that bridge right takes about fifteen lines of code, but the order of operations—and the difference between Device IDs and User IDs—is where most small teams accidentally introduce unattributed conversions or inflated user counts.

How Airbridge Determines the Device ID on iOS and Android

Before forwarding identifiers to RevenueCat, it helps to know what Airbridge actually stores as the Airbridge Device ID under the hood. Airbridge uses platform-supported UUIDs in a deterministic fallback chain:

PlatformPrimary IdentifierFirst FallbackFinal FallbackNotes for Subscription Apps
iOSIDFA (Identifier for Advertisers)IDFV (Identifier for Vendors)Randomly generated IDIDFA returns 00000000-0000-0000-0000-000000000000 when the user opts out of ATT, has not responded, or runs on an iOS Simulator. IDFV persists across same-vendor apps until all are uninstalled.
AndroidGAID (Google Advertising ID)AppSetId (Google Play App Set ID)Randomly generated IDGAID returns 00000000-0000-0000-0000-000000000000 when ad tracking is limited and is absent on devices without Google Play.

Because most iOS users opt out of ATT, the IDFA alone is frequently zeroed out. That is why passing $airbridgeDeviceId (the Airbridge Device UUID) explicitly into RevenueCat matters so much: it lets Airbridge connect a server-to-server TRIAL_CONVERTED or RENEWAL webhook back to the exact device record created at install, even when IDFA is unavailable.

RevenueCat's Airbridge integration documentation specifies five recommended Customer Attributes for device matching, while Airbridge's RevenueCat integration guide adds an explicit requirement for User ID matching. Understanding both prevents partial setups.

IdentifierDirectionWhere It Is SetPrimary Purpose
$airbridgeDeviceIdAirbridge SDK → RevenueCatsetAirbridgeDeviceID(deviceUUID)Maps S2S RevenueCat events to the exact Airbridge device record and attributed install cohort
$idfaDevice → RevenueCatcollectDeviceIdentifiers() (requires AdSupport on iOS)Advertising identifier on ATT-authorized iOS devices
$idfvDevice → RevenueCatcollectDeviceIdentifiers()Vendor-scoped iOS fallback identifier when IDFA is unavailable
$gpsAdIdDevice → RevenueCatcollectDeviceIdentifiers()Google Advertising ID on Android devices
$ipDevice → RevenueCatcollectDeviceIdentifiers()Device IP collected automatically by RevenueCat's helper
App User ID ↔ User IDRevenueCat ↔ Airbridge SDKAirbridge.setUserID(appUserId)Prevents Airbridge from generating random fallback User IDs and keeps unique subscriber counts aligned

Why Skipping Airbridge.setUserID() Inflates Subscriber Counts

Even if $airbridgeDeviceId is passed accurately, leaving the Airbridge User ID empty creates a subtle reporting bug. When RevenueCat sends a subscription webhook, it includes the customer's App User ID. If Airbridge cannot find a matching User ID logged by the Airbridge SDK on that user's earlier events (such as sign-up or sign-in), Airbridge generates a random User ID. Over a month of trials, conversions, and renewals, those generated IDs make the number of subscribing users reported in Airbridge higher than your real subscriber count in RevenueCat.

The fix is keeping both SDKs on the exact same user identifier—whether that is your own backend UUID (recommended for apps with login) or RevenueCat's anonymous appUserID for paywall-first apps that do not require an account before subscribing.

Exact Implementation Flow on iOS (Swift) and Android (Kotlin)

Initialize both the Airbridge SDK and the RevenueCat Purchases SDK at app launch, collect device identifiers, fetch the Airbridge Device UUID using Airbridge's Data Fetching API (fetchDeviceUUID), pass it into RevenueCat's setAirbridgeDeviceID(), and align the User ID.

iOS (Swift) Pattern

On iOS, make sure the AdSupport framework is imported in your project so RevenueCat can read $idfa when ATT is granted.

import AdSupport
import RevenueCat

// 1. Configure RevenueCat Purchases SDK
Purchases.configure(withAPIKey: "your_public_revenuecat_sdk_key")

// 2. Automatically collect $idfa, $idfv, and $ip in RevenueCat
Purchases.shared.attribution.collectDeviceIdentifiers()

// 3. Retrieve the DeviceUUID from the Airbridge SDK (via fetchDeviceUUID)
//    and forward it to RevenueCat before the first purchase occurs
let deviceUUID: String = /* Airbridge SDK fetchDeviceUUID result */
Purchases.shared.attribution.setAirbridgeDeviceID(deviceUUID)

// 4. Match RevenueCat's App User ID in the Airbridge SDK
let appUserID = Purchases.shared.appUserID
// Call Airbridge setUserID(appUserID) before sign-up/sign-in and paywall

Android (Kotlin) Pattern

On Android, RevenueCat's collectDeviceIdentifiers() automatically captures $gpsAdId and $ip.

import com.revenuecat.purchases.Purchases

// 1. Configure RevenueCat Purchases SDK
Purchases.configure(this, "your_public_revenuecat_sdk_key")

// 2. Automatically collect $gpsAdId and $ip in RevenueCat
Purchases.sharedInstance.collectDeviceIdentifiers()

// 3. Retrieve the DeviceUUID from the Airbridge SDK (via fetchDeviceUUID)
//    and forward it to RevenueCat before the first purchase occurs
val deviceUUID: String = /* Airbridge SDK fetchDeviceUUID result */
Purchases.sharedInstance.setAirbridgeDeviceID(deviceUUID)

// 4. Match RevenueCat's App User ID in the Airbridge SDK
val appUserID = Purchases.sharedInstance.appUserID
// Call Airbridge setUserID(appUserID) before sign-up/sign-in and paywall

Handling Login, Logout, and Anonymous-to-Identified Transitions

Many consumer subscription apps show a hard paywall during onboarding before creating an account, or let users sign in after starting a free trial. Keep the two SDKs synchronized at every identity transition:

  1. Cold launch (anonymous user): Immediately after RevenueCat initializes, pass RevenueCat's current appUserID into Airbridge.setUserID(...) so early onboarding events and initial trial events share the same ID.
  2. Sign-up or sign-in: When your user authenticates and you identify them in RevenueCat with your backend user ID, call Airbridge.setUserID(backendUserId) right alongside it—before firing Airbridge's Sign-up or Sign-in standard event so the ID attaches to those events.
  3. Sign-out: When a user logs out, call Airbridge.clearUserID() so the next person who signs in on the same device does not inherit the previous user's Airbridge User ID.

Order of execution makes or breaks iOS attribution. Follow this launch timeline so neither SDK fires prematurely:

  1. App launches: Initialize the Airbridge SDK and configure the RevenueCat Purchases SDK.
  2. Configure ATT wait timeout in Airbridge: Use Airbridge's ATT wait timeout setting (autoDetermineTrackingAuthorizationTimeoutInSecond in airbridge.json for React Native/Flutter, or the equivalent native iOS SDK option—default 30 seconds, configurable up to 3,600 seconds) so Airbridge waits for the user's ATT decision before dispatching the Install (App) event with the IDFA.
  3. Run initial identifier sync: Call collectDeviceIdentifiers(), fetch the Airbridge Device UUID via fetchDeviceUUID, call setAirbridgeDeviceID(deviceUUID), and call Airbridge.setUserID(...).
  4. Prompt for ATT when the app is active: After the user responds to the ATT prompt—if they grant permission—call collectDeviceIdentifiers() a second time. RevenueCat states it is completely safe to call collectDeviceIdentifiers() multiple times because only new or updated values (such as the newly unlocked $idfa) are transmitted.
  5. Present the paywall: Only after steps 3 and 4 have completed should the user reach your trial or subscription purchase button.

Caution on Optional Campaign Attributes in RevenueCat

RevenueCat also supports optional reserved customer attributes ($mediaSource, $campaign, $adGroup, $ad, $keyword, $creative) if you want Airbridge campaign labels visible inside RevenueCat charts and webhooks. RevenueCat warns that reserved attribution attributes are write-once per customer. Never write temporary placeholders like Organic, Unknown, or No User Consent while waiting for Airbridge attribution callbacks—if Airbridge returns final campaign values seconds later, RevenueCat cannot overwrite a placeholder you already saved.

How to Verify Your ID Matching End-to-End

Before releasing your build, verify ID alignment on a real test device (an iOS Simulator always returns a zeroed IDFA and is not a full production test):

  1. Inspect RevenueCat Customer View: Open the tester's profile in RevenueCat before making a purchase. Confirm $airbridgeDeviceId is populated with a valid UUID alongside $idfa/$idfv (iOS) or $gpsAdId (Android) and $ip.
  2. Complete a sandbox trial or purchase: Open the transaction in RevenueCat Customer History and confirm the Airbridge delivery succeeded (or inspect Last dispatched events in the Airbridge integration settings inside RevenueCat).
  3. Verify in Airbridge App Real-time Log: Wait up to 10 minutes for the S2S event to appear in Airbridge's App Real-time Log. Check that the Start Trial or Subscribe event carries the exact User ID matching RevenueCat's App User ID and attaches to the device's Install (App) record.
  4. Check your Actuals Report: Confirm the attributed conversion appears under the expected campaign and that unique user counts match event counts 1:1 for your test cohort.

Airbridge includes RevenueCat integration (up to 2 third-party integrations, alongside Adapty, Superwall, Amplitude, or GA4), real-time Actuals Reports, and Predictive LTV (1–180 days) on the self-serve Core Plan—starting with a 14-day free trial, then $40+/mo for 500,000 data points/month ($0.0001 per extra) with no annual lock-in.

FAQS

Frequently Asked Questions

What happens if I pass the Airbridge Device ID to RevenueCat but forget to call Airbridge.setUserID?

If Airbridge cannot match the incoming RevenueCat App User ID to a User ID logged in the Airbridge SDK, Airbridge generates a random User ID for the subscription event. That mismatch can inflate unique subscriber user counts in Airbridge reports compared to RevenueCat.

Is it safe to call RevenueCat's collectDeviceIdentifiers() more than once?

Yes—RevenueCat explicitly recommends calling collectDeviceIdentifiers() right after configuring the Purchases SDK (before the first purchase) and calling it again if an iOS 14.5+ user later accepts the ATT prompt. RevenueCat only transmits new or updated values such as $idfa.

What does Airbridge use as the Device ID if a user denies ATT on iOS or limits ad tracking on Android?

On iOS, Airbridge falls back from IDFA to IDFV, and if neither is available, to a randomly generated ID; on Android, it falls back from GAID to AppSetId, and then to a randomly generated ID. Passing $airbridgeDeviceId via setAirbridgeDeviceID() ensures RevenueCat webhooks still match that Airbridge device record when advertising IDs are zeroed out.

Can I match IDs if my app shows a paywall before users create an account?

Yes—right after RevenueCat initializes on cold launch, read RevenueCat's generated anonymous appUserID and pass it into Airbridge.setUserID(), then update Airbridge.setUserID() again if the user later signs up or logs into an account.

Why shouldn't I set Organic or Unknown as a default campaign attribute in RevenueCat?

RevenueCat stores reserved campaign attributes ($mediaSource, $campaign, $adGroup, $ad, $keyword, $creative) as write-once values per customer. Setting a placeholder like Organic or Unknown permanently locks that field and prevents final Airbridge campaign values from being saved later.