Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.appstack.tech/llms.txt

Use this file to discover all available pages before exploring further.

Use Cursor, Claude Code, or another AI to help you implement the RevenueCat integration with Appstack.

Open in Cursor
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
    }
}
React Native minimum versionThe setAppstackAttributionParams is available in react-native-purchases 9.12.0 and above. If you’re on 8.12.0 or any earlier version, the snippet above will fail because the method doesn’t exist on the Purchases object yet. Upgrade react-native-purchases to 9.12.0+ before integrating.
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.

List of events

Below is a list of events you can forward to ad networks to optimize your campaigns.
NameDefinition
rc_trial_startedFired when a user begins a free trial. Triggered on the initial purchase when the period type is TRIAL.
rc_trial_qualifiedFired when a free trial is still active two hours after it started — meaning the user did not cancel within the qualification window.
rc_trial_convertedFired when a free trial successfully converts to a paid subscription. This happens on the first renewal after the trial period ends.
rc_intro_startedFired when a user begins an intro offer — a paid trial at a discounted price (e.g., $0.99 for the first week). Triggered on the initial purchase when the period type is INTRO
rc_trial_intro_startedFired when either a free trial starts (rc_trial_started) or an intro offer starts (rc_intro_started). The event triggers as soon as at least one of these conditions is met.
rc_trial_intro_qualifiedFired when either a free trial qualifies (rc_trial_qualified) or or an intro offer starts (rc_intro_started). The event triggers as soon as at least one of these conditions is met.
rc_initial_purchaseFired when any of the following occur: a free trial starts (rc_trial_started), an intro offer starts (rc_intro_started), or a full-price subscription starts (rc_subscription_started). The event triggers as soon as at least one of these conditions is met.
rc_initial_purchase_qualifiedFired when any of the following occur: a trial qualified happens (rc_trial_qualified), an intro offer starts (rc_intro_started), or a full-price subscription starts (rc_subscription_started). The event triggers as soon as at least one of these conditions is met.
rc_subscription_startedFired when a user starts a paid subscription at full price, with no trial or intro offer involved. Triggered on the initial purchase when the period type is NORMAL
rc_subscription_renewedFired on each successful renewal of an active subscription. Indicates the user was billed again and remains subscribed for another period.
rc_non_renewing_purchaseFired when a user makes a one-time, non-subscription purchase — any product that is not an auto-renewing subscription (e.g., consumables or non-consumable in-app purchases). Unlike subscription events, this purchase does not renew automatically.

Use Cursor, Claude Code, or another AI to validate your existing RevenueCat + Appstack integration.

Open in Cursor