Skip to main content
With the RevenueCat integration, you can:
  1. Use Revenuecat in-app events to run enhanced app campaigns.
  2. Unlock attribution-based paywall optimization.
To successfully connect RevenueCat, you must:
  1. Have Owner/Admin access to an Appstack organization.
  2. Have access to the correct RevenueCat account.

Connect to RevenueCat

Follow the steps to ensure the RevenueCat integration works:
1

SDK configuration

After configuring the Purchases SDK and before the first purchase occurs, call setAppstackAttributionParams() with the attribution data from the Appstack SDK. This single call sets the $appstackId, campaign attribution attributes ($mediaSource, $campaign, $adGroup, $ad, $keyword), click IDs, and device identifiers — no need to call collectDeviceIdentifiers() separately.The call also syncs attributes to the RevenueCat backend and fetches fresh offerings before returning, so Appstack-based targeting is applied before your paywall loads.
Learn more about the RevenueCat x Appstack integration by reading this article.
import AdSupport
// ...
Purchases.configure(withAPIKey: "public_sdk_key")
// ...

Task {
    let base = await AppstackAttributionSdk.shared.getAttributionParams() ?? [:]
    var params = base
    if let id = AppstackAttributionSdk.shared.getAppstackId() {
        params["appstack_id"] = id
    }

    // Forward to RevenueCat — syncs attributes and fetches fresh offerings
    // so Appstack-based targeting is applied before the callback returns.
    Purchases.shared.attribution.setAppstackAttributionParams(params) { offerings, error in
        // Use `offerings` to present the correct paywall for this user
    }
}
iOS App Tracking Transparency (iOS 14.5+)If you request App Tracking permission through ATT to access the IDFA, call setAppstackAttributionParams() again after the customer grants permission, rebuilding params from the latest getAttributionParams() and getAppstackId() values as in the code examples above. The AdSupport framework is required to collect the IDFA on iOS.
2

Copy the credentials

  1. In Appstack, from the side menu, select Integrations > RevenueCat.
  2. Copy the webhook URL.
  3. Copy the authorization header.
3

Paste the credentials

  1. In RevenueCat, from the dashboard, go to Integrations > Attribution > Appstack.
  2. Paste the webhook URL.
  3. Paste the authorization header.
After the integration is active on RevenueCat’s platform, it can take 30-60 minutes to appear as active on Appstack’s side.
The integration will show an error if less than 50% of events received over the last 24 hours include an appstackId. When this threshold is not met, these events cannot be used in ad network integration pages.

Events received

In-app event nameDefinition
Initial PurchaseFirst-time subscription or one-time purchase
RenewalSubscription renewal
CancellationSubscription cancelled
UncancellationSubscription cancellation reversed
Non-Renewing PurchaseOne-time purchase (non-subscription)
Subscription PausedSubscription temporarily paused
ExpirationSubscription expired
Billing IssuePayment processing failed
Product ChangeUser changed subscription tier
TransferSubscription transferred between users

Integration capabilities

Includes RevenueSupports Negative RevenueSends Sandbox EventsIncludes Customer AttributesSends Transfer Events