Build With RevenueCat

Build a customized mobile subscription business with RevenueCat. We do the heavy lifting of normalizing subscribers from any source and maintain a single source of truth for subscription status, so you can get back to building your app.

RevenueCat is a powerful, secure, reliable, and free to use in-app purchase server with global support. All you need to get started is an API key.

Get Started    REST API Endpoints


Integrate Purchases SDK with Branch for precise revenue tracking

With our Branch integration you can:

  • Accurately track subscriptions generated from Branch campaigns, allowing you to know precisely how much revenue your campaigns generate.
  • Send trial conversions and renewals directly from RevenueCat to Branch, allowing for tracking without an app open.
  • Continue to follow your cohorts for months to know the long tail revenue generated by your campaigns.


You're viewing outdated documentation

Head over to the latest version of the docs to see the new Branch integration guide:

1. Set Branch user identity

In order to attach attribution data to the correct user, make sure the App User Ids for RevenueCat and Branch match. The easiest way to do this is to set the Branch SDK identity to match the Purchases App User Id whether you're providing your own ids or using our randomly generated ids.

If you prefer to keep a separate user identity between Branch and RevenueCat, use the networkUserId parameter when adding attribution to specify the Branch user ID to attach to.


Install the Branch SDK

You will need to add the Branch SDK to your app before you can connect it with RevenueCat

// login

// logout
// login
[[Branch getInstance] setIdentity:@"my_app_user_id"];

// logout
[[Branch getInstance] logout];
// login

// logout
// login

// logout

2. Send attribution data to RevenueCat

When you initialize a Branch session use the addAttributionData method for passing the attribution data dictionary in the callback:

Attaching attribution data to a user

import Branch
Branch.getInstance().initSession(launchOptions: launchOptions) { (data, error) in
    if let data = data {
        Purchases.addAttributionData(data, from: .branch)
#import "Branch/Branch.h"
[[Branch getInstance] initSessionWithLaunchOptions:launchOptions
                        andRegisterDeepLinkHandler:^(NSDictionary *data,
                                                     NSError *error) {
  [RCPurchases addAttributionData:data 
Branch branch = Branch.getInstance(getApplicationContext());
branch.initSession(new BranchReferralInitListener(){
    public void onInitFinished(JSONObject referringParams, BranchError error) {
        if (error == null) {
        } else {
            Log.i("MyApp", error.getMessage());
}, this.getIntent().getData(), this);
branch.subscribe(({ error, params }) => {
  if (error) {
    console.error('Error from Branch: ' + error)

    Purchases.addAttributionData(params, Purchases.ATTRIBUTION_NETWORKS.BRANCH)


Remove SDK Purchase Tracking

Make sure to remove all client side tracking of revenue. Since RevenueCat will be sending events for all revenue actions, tracking purchases with the Branch SDK directly can lead to double counting of revenue in Branch.

3. Send RevenueCat events into Branch

After you've set up the Purchase SDK to send attribution data from Branch to RevenueCat, you can "turn on" the integration and configure the event tokens from the RevenueCat dashboard.

  1. Navigate to your app in the RevenueCat dashboard and choose 'Branch' from the integrations menu
  2. Add your test key and live key from Branch
  3. Enter the event names that RevenueCat will send or choose the default event names
  4. Select whether you want RevenueCat to report proceeds (after app store cut) or revenue (gross sales)

Branch configuration screen


You've done it!

You should start seeing events from RevenueCat appear in Branch

Updated 5 months ago


Integrate Purchases SDK with Branch for precise revenue tracking

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.